LibreOffice
LibreOffice 7.2 SDK C/C++ API Reference
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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 /*
21  * This file is part of LibreOffice published API.
22  */
23 
24 #ifndef INCLUDED_RTL_CIPHER_H
25 #define INCLUDED_RTL_CIPHER_H
26 
27 #include "sal/config.h"
28 
29 #include "sal/saldllapi.h"
30 #include "sal/types.h"
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
38 typedef void* rtlCipher;
39 
44 {
49 };
50 
54 
59 {
65 };
66 
70 
75 {
81 };
82 
86 
87 
91 {
101 };
102 
106 
107 
116 SAL_DLLPUBLIC rtlCipher SAL_CALL rtl_cipher_create (
117  rtlCipherAlgorithm Algorithm,
118  rtlCipherMode Mode
120 
132 SAL_DLLPUBLIC rtlCipherError SAL_CALL rtl_cipher_init (
133  rtlCipher Cipher,
134  rtlCipherDirection Direction,
135  const sal_uInt8 *pKeyData, sal_Size nKeyLen,
136  const sal_uInt8 *pArgData, sal_Size nArgLen
138 
150 SAL_DLLPUBLIC rtlCipherError SAL_CALL rtl_cipher_encode (
151  rtlCipher Cipher,
152  const void *pData, sal_Size nDatLen,
153  sal_uInt8 *pBuffer, sal_Size nBufLen
155 
167 SAL_DLLPUBLIC rtlCipherError SAL_CALL rtl_cipher_decode (
168  rtlCipher Cipher,
169  const void *pData, sal_Size nDatLen,
170  sal_uInt8 *pBuffer, sal_Size nBufLen
172 
177 SAL_DLLPUBLIC void SAL_CALL rtl_cipher_destroy (
178  rtlCipher Cipher
180 
188 SAL_DLLPUBLIC rtlCipher SAL_CALL rtl_cipher_createBF (
189  rtlCipherMode Mode
191 
195 SAL_DLLPUBLIC rtlCipherError SAL_CALL rtl_cipher_initBF (
196  rtlCipher Cipher,
197  rtlCipherDirection Direction,
198  const sal_uInt8 *pKeyData, sal_Size nKeyLen,
199  const sal_uInt8 *pArgData, sal_Size nArgLen
201 
205 SAL_DLLPUBLIC rtlCipherError SAL_CALL rtl_cipher_encodeBF (
206  rtlCipher Cipher,
207  const void *pData, sal_Size nDatLen,
208  sal_uInt8 *pBuffer, sal_Size nBufLen
210 
214 SAL_DLLPUBLIC rtlCipherError SAL_CALL rtl_cipher_decodeBF (
215  rtlCipher Cipher,
216  const void *pData, sal_Size nDatLen,
217  sal_uInt8 *pBuffer, sal_Size nBufLen
219 
223 SAL_DLLPUBLIC void SAL_CALL rtl_cipher_destroyBF (
224  rtlCipher Cipher
226 
237 SAL_DLLPUBLIC rtlCipher SAL_CALL rtl_cipher_createARCFOUR (
238  rtlCipherMode Mode
240 
244 SAL_DLLPUBLIC rtlCipherError SAL_CALL rtl_cipher_initARCFOUR (
245  rtlCipher Cipher,
246  rtlCipherDirection Direction,
247  const sal_uInt8 *pKeyData, sal_Size nKeyLen,
248  const sal_uInt8 *pArgData, sal_Size nArgLen
250 
254 SAL_DLLPUBLIC rtlCipherError SAL_CALL rtl_cipher_encodeARCFOUR (
255  rtlCipher Cipher,
256  const void *pData, sal_Size nDatLen,
257  sal_uInt8 *pBuffer, sal_Size nBufLen
259 
263 SAL_DLLPUBLIC rtlCipherError SAL_CALL rtl_cipher_decodeARCFOUR (
264  rtlCipher Cipher,
265  const void *pData, sal_Size nDatLen,
266  sal_uInt8 *pBuffer, sal_Size nBufLen
268 
273  rtlCipher Cipher
275 
276 #ifdef __cplusplus
277 }
278 #endif
279 
280 #endif /* ! INCLUDED_RTL_CIPHER_H */
281 
282 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Definition: cipher.h:77
__rtl_CipherMode
Cipher Mode enumeration.
Definition: cipher.h:58
Definition: cipher.h:76
CPPU_DLLPUBLIC void SAL_THROW_EXTERN_C()
This method is called to wait for a reply of a previously sent request.
enum __rtl_CipherError rtlCipherError
Error Code type.
Definition: cipher.h:105
Definition: cipher.h:64
SAL_DLLPUBLIC rtlCipher rtl_cipher_create(rtlCipherAlgorithm Algorithm, rtlCipherMode Mode) SAL_THROW_EXTERN_C()
Create a cipher handle for the given algorithm and mode.
__rtl_CipherAlgorithm
Cipher Algorithm enumeration.
Definition: cipher.h:43
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_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 rtlCipher rtl_cipher_createARCFOUR(rtlCipherMode Mode) SAL_THROW_EXTERN_C()
Create a RC4 cipher handle for the given 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.
Definition: cipher.h:97
Definition: cipher.h:79
Definition: cipher.h:95
Definition: cipher.h:94
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:100
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.
#define SAL_DLLPUBLIC
Definition: saldllapi.h:34
SAL_DLLPUBLIC void rtl_cipher_destroyARCFOUR(rtlCipher Cipher) SAL_THROW_EXTERN_C()
Destroy a RC4 cipher handle.
SAL_DLLPUBLIC void rtl_cipher_destroyBF(rtlCipher Cipher) SAL_THROW_EXTERN_C()
Destroy a Blowfish cipher handle.
Definition: cipher.h:45
Definition: cipher.h:78
Definition: cipher.h:92
enum __rtl_CipherDirection rtlCipherDirection
Cipher Direction type.
Definition: cipher.h:85
Definition: cipher.h:98
#define SAL_MAX_ENUM
Definition: types.h:205
void * rtlCipher
Cipher Handle opaque type.
Definition: cipher.h:38
enum __rtl_CipherAlgorithm rtlCipherAlgorithm
Cipher Algorithm type.
Definition: cipher.h:53
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_destroy(rtlCipher Cipher) SAL_THROW_EXTERN_C()
Destroy a cipher handle.
__rtl_CipherError
Error Code enumeration.
Definition: cipher.h:90
unsigned char sal_uInt8
Definition: types.h:44
enum __rtl_CipherMode rtlCipherMode
Cipher Mode type.
Definition: cipher.h:69
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.
Definition: cipher.h:62
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:63
Definition: cipher.h:61
Definition: cipher.h:99
Definition: cipher.h:60
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:96
Definition: cipher.h:47
__rtl_CipherDirection
Cipher Direction enumeration.
Definition: cipher.h:74
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:46
Definition: cipher.h:93