AlterOffice
AlterOffice 2026.2 SDK C/C++ API Reference
cipher.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 
3 
4 #ifndef INCLUDED_RTL_CIPHER_H
5 #define INCLUDED_RTL_CIPHER_H
6 
7 #include "sal/config.h"
8 
9 #include "sal/saldllapi.h"
10 #include "sal/types.h"
11 
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15 
18 typedef void* rtlCipher;
19 
24 {
29 };
30 
34 
39 {
45 };
46 
49 typedef enum __rtl_CipherMode rtlCipherMode;
50 
55 {
61 };
62 
66 
67 
71 {
81 };
82 
86 
87 
97  rtlCipherAlgorithm Algorithm,
98  rtlCipherMode Mode
100 
113  rtlCipher Cipher,
114  rtlCipherDirection Direction,
115  const sal_uInt8 *pKeyData, sal_Size nKeyLen,
116  const sal_uInt8 *pArgData, sal_Size nArgLen
118 
131  rtlCipher Cipher,
132  const void *pData, sal_Size nDatLen,
133  sal_uInt8 *pBuffer, sal_Size nBufLen
135 
148  rtlCipher Cipher,
149  const void *pData, sal_Size nDatLen,
150  sal_uInt8 *pBuffer, sal_Size nBufLen
152 
160  rtlCipher Cipher
162 
171  rtlCipherMode Mode
173 
178  rtlCipher Cipher,
179  rtlCipherDirection Direction,
180  const sal_uInt8 *pKeyData, sal_Size nKeyLen,
181  const sal_uInt8 *pArgData, sal_Size nArgLen
183 
188  rtlCipher Cipher,
189  const void *pData, sal_Size nDatLen,
190  sal_uInt8 *pBuffer, sal_Size nBufLen
192 
197  rtlCipher Cipher,
198  const void *pData, sal_Size nDatLen,
199  sal_uInt8 *pBuffer, sal_Size nBufLen
201 
206  rtlCipher Cipher
208 
220  rtlCipherMode Mode
222 
227  rtlCipher Cipher,
228  rtlCipherDirection Direction,
229  const sal_uInt8 *pKeyData, sal_Size nKeyLen,
230  const sal_uInt8 *pArgData, sal_Size nArgLen
232 
237  rtlCipher Cipher,
238  const void *pData, sal_Size nDatLen,
239  sal_uInt8 *pBuffer, sal_Size nBufLen
241 
246  rtlCipher Cipher,
247  const void *pData, sal_Size nDatLen,
248  sal_uInt8 *pBuffer, sal_Size nBufLen
250 
255  rtlCipher Cipher
257 
258 #ifdef __cplusplus
259 }
260 #endif
261 
262 #endif /* ! INCLUDED_RTL_CIPHER_H */
263 
264 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
#define SAL_DLLPUBLIC
Definition: saldllapi.h:14
#define SAL_MAX_ENUM
Definition: types.h:185
unsigned char sal_uInt8
Definition: types.h:24
#define SAL_THROW_EXTERN_C()
Nothrow specification for C functions.
Definition: types.h:314
__rtl_CipherMode
Cipher Mode enumeration.
Definition: cipher.h:39
@ rtl_Cipher_ModeStream
Definition: cipher.h:42
@ rtl_Cipher_ModeCBC
Definition: cipher.h:41
@ rtl_Cipher_ModeInvalid
Definition: cipher.h:43
@ rtl_Cipher_ModeECB
Definition: cipher.h:40
@ rtl_Cipher_Mode_FORCE_EQUAL_SIZE
Definition: cipher.h:44
SAL_DLLPUBLIC rtlCipher rtl_cipher_createARCFOUR(rtlCipherMode Mode) SAL_THROW_EXTERN_C()
Create a RC4 cipher handle for the given mode.
enum __rtl_CipherAlgorithm rtlCipherAlgorithm
Cipher Algorithm type.
Definition: cipher.h:33
SAL_DLLPUBLIC rtlCipherError rtl_cipher_decode(rtlCipher Cipher, const void *pData, sal_Size nDatLen, sal_uInt8 *pBuffer, sal_Size nBufLen) SAL_THROW_EXTERN_C()
Decode a buffer under a given cipher algorithm.
enum __rtl_CipherDirection rtlCipherDirection
Cipher Direction type.
Definition: cipher.h:65
SAL_DLLPUBLIC rtlCipherError rtl_cipher_encodeARCFOUR(rtlCipher Cipher, const void *pData, sal_Size nDatLen, sal_uInt8 *pBuffer, sal_Size nBufLen) SAL_THROW_EXTERN_C()
Encode a buffer under the RC4 cipher algorithm.
SAL_DLLPUBLIC void rtl_cipher_destroyBF(rtlCipher Cipher) SAL_THROW_EXTERN_C()
Destroy a Blowfish cipher handle.
__rtl_CipherDirection
Cipher Direction enumeration.
Definition: cipher.h:55
@ rtl_Cipher_DirectionEncode
Definition: cipher.h:58
@ rtl_Cipher_DirectionBoth
Definition: cipher.h:56
@ rtl_Cipher_DirectionDecode
Definition: cipher.h:57
@ rtl_Cipher_Direction_FORCE_EQUAL_SIZE
Definition: cipher.h:60
@ rtl_Cipher_DirectionInvalid
Definition: cipher.h:59
SAL_DLLPUBLIC void rtl_cipher_destroy(rtlCipher Cipher) SAL_THROW_EXTERN_C()
Destroy a cipher handle.
void * rtlCipher
Cipher Handle opaque type.
Definition: cipher.h:18
SAL_DLLPUBLIC rtlCipherError rtl_cipher_initBF(rtlCipher Cipher, rtlCipherDirection Direction, const sal_uInt8 *pKeyData, sal_Size nKeyLen, const sal_uInt8 *pArgData, sal_Size nArgLen) SAL_THROW_EXTERN_C()
Inititialize a Blowfish cipher for the given direction.
enum __rtl_CipherError rtlCipherError
Error Code type.
Definition: cipher.h:85
SAL_DLLPUBLIC void rtl_cipher_destroyARCFOUR(rtlCipher Cipher) SAL_THROW_EXTERN_C()
Destroy a RC4 cipher handle.
SAL_DLLPUBLIC rtlCipher rtl_cipher_create(rtlCipherAlgorithm Algorithm, rtlCipherMode Mode) SAL_THROW_EXTERN_C()
Create a cipher handle for the given algorithm and mode.
SAL_DLLPUBLIC rtlCipherError rtl_cipher_initARCFOUR(rtlCipher Cipher, rtlCipherDirection Direction, const sal_uInt8 *pKeyData, sal_Size nKeyLen, const sal_uInt8 *pArgData, sal_Size nArgLen) SAL_THROW_EXTERN_C()
Inititialize a RC4 cipher for the given direction.
SAL_DLLPUBLIC rtlCipherError rtl_cipher_decodeBF(rtlCipher Cipher, const void *pData, sal_Size nDatLen, sal_uInt8 *pBuffer, sal_Size nBufLen) SAL_THROW_EXTERN_C()
Decode a buffer under the Blowfish cipher algorithm.
__rtl_CipherError
Error Code enumeration.
Definition: cipher.h:71
@ rtl_Cipher_E_Unknown
Definition: cipher.h:79
@ rtl_Cipher_E_Algorithm
Definition: cipher.h:74
@ rtl_Cipher_E_Direction
Definition: cipher.h:75
@ rtl_Cipher_E_None
Definition: cipher.h:72
@ rtl_Cipher_E_Mode
Definition: cipher.h:76
@ rtl_Cipher_E_BufferSize
Definition: cipher.h:77
@ rtl_Cipher_E_Argument
Definition: cipher.h:73
@ rtl_Cipher_E_Memory
Definition: cipher.h:78
@ rtl_Cipher_E_FORCE_EQUAL_SIZE
Definition: cipher.h:80
SAL_DLLPUBLIC rtlCipher rtl_cipher_createBF(rtlCipherMode Mode) SAL_THROW_EXTERN_C()
Create a Blowfish cipher handle for the given mode.
SAL_DLLPUBLIC rtlCipherError rtl_cipher_encode(rtlCipher Cipher, const void *pData, sal_Size nDatLen, sal_uInt8 *pBuffer, sal_Size nBufLen) SAL_THROW_EXTERN_C()
Encode a buffer under a given cipher algorithm.
SAL_DLLPUBLIC rtlCipherError rtl_cipher_decodeARCFOUR(rtlCipher Cipher, const void *pData, sal_Size nDatLen, sal_uInt8 *pBuffer, sal_Size nBufLen) SAL_THROW_EXTERN_C()
Decode a buffer under the RC4 cipher algorithm.
SAL_DLLPUBLIC rtlCipherError rtl_cipher_encodeBF(rtlCipher Cipher, const void *pData, sal_Size nDatLen, sal_uInt8 *pBuffer, sal_Size nBufLen) SAL_THROW_EXTERN_C()
Encode a buffer under the Blowfish cipher algorithm.
SAL_DLLPUBLIC rtlCipherError rtl_cipher_init(rtlCipher Cipher, rtlCipherDirection Direction, const sal_uInt8 *pKeyData, sal_Size nKeyLen, const sal_uInt8 *pArgData, sal_Size nArgLen) SAL_THROW_EXTERN_C()
Inititialize a cipher for the given direction.
__rtl_CipherAlgorithm
Cipher Algorithm enumeration.
Definition: cipher.h:24
@ rtl_Cipher_AlgorithmInvalid
Definition: cipher.h:27
@ rtl_Cipher_AlgorithmARCFOUR
Definition: cipher.h:26
@ rtl_Cipher_Algorithm_FORCE_EQUAL_SIZE
Definition: cipher.h:28
@ rtl_Cipher_AlgorithmBF
Definition: cipher.h:25
enum __rtl_CipherMode rtlCipherMode
Cipher Mode type.
Definition: cipher.h:49