LibreOffice
LibreOffice 5.3 SDK C/C++ API Reference
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #ifndef INCLUDED_RTL_CIPHER_H
21 #define INCLUDED_RTL_CIPHER_H
22 
23 #include <sal/config.h>
24 
25 #include <sal/saldllapi.h>
26 #include <sal/types.h>
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 /*========================================================================
33  *
34  * rtlCipher interface.
35  *
36  *======================================================================*/
39 typedef void* rtlCipher;
40 
41 
46 {
51 };
52 
56 
57 
62 {
68 };
69 
73 
74 
79 {
85 };
86 
90 
91 
95 {
105 };
106 
110 
111 
120 SAL_DLLPUBLIC rtlCipher SAL_CALL rtl_cipher_create (
121  rtlCipherAlgorithm Algorithm,
122  rtlCipherMode Mode
124 
125 
137 SAL_DLLPUBLIC rtlCipherError SAL_CALL rtl_cipher_init (
138  rtlCipher Cipher,
139  rtlCipherDirection Direction,
140  const sal_uInt8 *pKeyData, sal_Size nKeyLen,
141  const sal_uInt8 *pArgData, sal_Size nArgLen
143 
144 
156 SAL_DLLPUBLIC rtlCipherError SAL_CALL rtl_cipher_encode (
157  rtlCipher Cipher,
158  const void *pData, sal_Size nDatLen,
159  sal_uInt8 *pBuffer, sal_Size nBufLen
161 
162 
174 SAL_DLLPUBLIC rtlCipherError SAL_CALL rtl_cipher_decode (
175  rtlCipher Cipher,
176  const void *pData, sal_Size nDatLen,
177  sal_uInt8 *pBuffer, sal_Size nBufLen
179 
180 
185 SAL_DLLPUBLIC void SAL_CALL rtl_cipher_destroy (
186  rtlCipher Cipher
188 
189 
190 /*========================================================================
191  *
192  * rtl_cipherBF (Blowfish) interface.
193  *
194  *======================================================================*/
202 SAL_DLLPUBLIC rtlCipher SAL_CALL rtl_cipher_createBF (
203  rtlCipherMode Mode
205 
206 
210 SAL_DLLPUBLIC rtlCipherError SAL_CALL rtl_cipher_initBF (
211  rtlCipher Cipher,
212  rtlCipherDirection Direction,
213  const sal_uInt8 *pKeyData, sal_Size nKeyLen,
214  const sal_uInt8 *pArgData, sal_Size nArgLen
216 
217 
221 SAL_DLLPUBLIC rtlCipherError SAL_CALL rtl_cipher_encodeBF (
222  rtlCipher Cipher,
223  const void *pData, sal_Size nDatLen,
224  sal_uInt8 *pBuffer, sal_Size nBufLen
226 
227 
231 SAL_DLLPUBLIC rtlCipherError SAL_CALL rtl_cipher_decodeBF (
232  rtlCipher Cipher,
233  const void *pData, sal_Size nDatLen,
234  sal_uInt8 *pBuffer, sal_Size nBufLen
236 
237 
241 SAL_DLLPUBLIC void SAL_CALL rtl_cipher_destroyBF (
242  rtlCipher Cipher
244 
245 
246 /*========================================================================
247  *
248  * rtl_cipherARCFOUR (RC4) interface.
249  *
250  *======================================================================*/
261 SAL_DLLPUBLIC rtlCipher SAL_CALL rtl_cipher_createARCFOUR (
262  rtlCipherMode Mode
264 
265 
269 SAL_DLLPUBLIC rtlCipherError SAL_CALL rtl_cipher_initARCFOUR (
270  rtlCipher Cipher,
271  rtlCipherDirection Direction,
272  const sal_uInt8 *pKeyData, sal_Size nKeyLen,
273  const sal_uInt8 *pArgData, sal_Size nArgLen
275 
276 
280 SAL_DLLPUBLIC rtlCipherError SAL_CALL rtl_cipher_encodeARCFOUR (
281  rtlCipher Cipher,
282  const void *pData, sal_Size nDatLen,
283  sal_uInt8 *pBuffer, sal_Size nBufLen
285 
286 
290 SAL_DLLPUBLIC rtlCipherError SAL_CALL rtl_cipher_decodeARCFOUR (
291  rtlCipher Cipher,
292  const void *pData, sal_Size nDatLen,
293  sal_uInt8 *pBuffer, sal_Size nBufLen
295 
296 
301  rtlCipher Cipher
303 
304 
305 /*========================================================================
306  *
307  * The End.
308  *
309  *======================================================================*/
310 
311 #ifdef __cplusplus
312 }
313 #endif
314 
315 #endif /* ! INCLUDED_RTL_CIPHER_H */
316 
317 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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.
Definition: cipher.h:102
#define SAL_DLLPUBLIC
Definition: saldllapi.h:30
SAL_DLLPUBLIC void rtl_cipher_destroy(rtlCipher Cipher) SAL_THROW_EXTERN_C()
Destroy a cipher handle.
Definition: cipher.h:103
__rtl_CipherDirection
Cipher Direction enumeration.
Definition: cipher.h:78
SAL_DLLPUBLIC void rtl_cipher_destroyARCFOUR(rtlCipher Cipher) SAL_THROW_EXTERN_C()
Destroy a RC4 cipher handle.
Definition: cipher.h:48
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_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.
SAL_DLLPUBLIC void rtl_cipher_destroyBF(rtlCipher Cipher) SAL_THROW_EXTERN_C()
Destroy a Blowfish cipher handle.
#define SAL_MAX_ENUM
Definition: types.h:242
Definition: cipher.h:64
enum __rtl_CipherAlgorithm rtlCipherAlgorithm
Cipher Algorithm type.
Definition: cipher.h:55
SAL_DLLPUBLIC rtlCipher rtl_cipher_createBF(rtlCipherMode Mode) SAL_THROW_EXTERN_C()
Create a Blowfish cipher handle for the given mode.
Definition: cipher.h:63
void * rtlCipher
Cipher Handle opaque type.
Definition: cipher.h:39
Definition: cipher.h:67
SAL_DLLPUBLIC rtlCipher rtl_cipher_createARCFOUR(rtlCipherMode Mode) SAL_THROW_EXTERN_C()
Create a RC4 cipher handle for the given mode.
unsigned char sal_uInt8
Definition: types.h:54
enum __rtl_CipherDirection rtlCipherDirection
Cipher Direction type.
Definition: cipher.h:89
Definition: cipher.h:100
Definition: cipher.h:49
Definition: cipher.h:81
Definition: cipher.h:65
__rtl_CipherAlgorithm
Cipher Algorithm enumeration.
Definition: cipher.h:45
Definition: cipher.h:101
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.
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.
Definition: cipher.h:66
Definition: cipher.h:80
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.
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.
Definition: cipher.h:104
enum __rtl_CipherError rtlCipherError
Error Code type.
Definition: cipher.h:109
Definition: cipher.h:97
Definition: cipher.h:47
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.
Definition: cipher.h:83
Definition: cipher.h:99
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.
Definition: cipher.h:98
SAL_DLLPUBLIC rtlCipher rtl_cipher_create(rtlCipherAlgorithm Algorithm, rtlCipherMode Mode) SAL_THROW_EXTERN_C()
Create a cipher handle for the given algorithm and mode.
enum __rtl_CipherMode rtlCipherMode
Cipher Mode type.
Definition: cipher.h:72
__rtl_CipherMode
Cipher Mode enumeration.
Definition: cipher.h:61
#define SAL_THROW_EXTERN_C()
Nothrow specification for C functions.
Definition: types.h:370
__rtl_CipherError
Error Code enumeration.
Definition: cipher.h:94
Definition: cipher.h:82
Definition: cipher.h:96