LibreOffice
LibreOffice 6.0 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  * 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 
34 typedef void* rtlCipher;
35 
40 {
45 };
46 
50 
55 {
61 };
62 
66 
71 {
77 };
78 
82 
83 
87 {
97 };
98 
102 
103 
112 SAL_DLLPUBLIC rtlCipher SAL_CALL rtl_cipher_create (
113  rtlCipherAlgorithm Algorithm,
114  rtlCipherMode Mode
116 
128 SAL_DLLPUBLIC rtlCipherError SAL_CALL rtl_cipher_init (
129  rtlCipher Cipher,
130  rtlCipherDirection Direction,
131  const sal_uInt8 *pKeyData, sal_Size nKeyLen,
132  const sal_uInt8 *pArgData, sal_Size nArgLen
134 
146 SAL_DLLPUBLIC rtlCipherError SAL_CALL rtl_cipher_encode (
147  rtlCipher Cipher,
148  const void *pData, sal_Size nDatLen,
149  sal_uInt8 *pBuffer, sal_Size nBufLen
151 
163 SAL_DLLPUBLIC rtlCipherError SAL_CALL rtl_cipher_decode (
164  rtlCipher Cipher,
165  const void *pData, sal_Size nDatLen,
166  sal_uInt8 *pBuffer, sal_Size nBufLen
168 
173 SAL_DLLPUBLIC void SAL_CALL rtl_cipher_destroy (
174  rtlCipher Cipher
176 
184 SAL_DLLPUBLIC rtlCipher SAL_CALL rtl_cipher_createBF (
185  rtlCipherMode Mode
187 
191 SAL_DLLPUBLIC rtlCipherError SAL_CALL rtl_cipher_initBF (
192  rtlCipher Cipher,
193  rtlCipherDirection Direction,
194  const sal_uInt8 *pKeyData, sal_Size nKeyLen,
195  const sal_uInt8 *pArgData, sal_Size nArgLen
197 
201 SAL_DLLPUBLIC rtlCipherError SAL_CALL rtl_cipher_encodeBF (
202  rtlCipher Cipher,
203  const void *pData, sal_Size nDatLen,
204  sal_uInt8 *pBuffer, sal_Size nBufLen
206 
210 SAL_DLLPUBLIC rtlCipherError SAL_CALL rtl_cipher_decodeBF (
211  rtlCipher Cipher,
212  const void *pData, sal_Size nDatLen,
213  sal_uInt8 *pBuffer, sal_Size nBufLen
215 
219 SAL_DLLPUBLIC void SAL_CALL rtl_cipher_destroyBF (
220  rtlCipher Cipher
222 
233 SAL_DLLPUBLIC rtlCipher SAL_CALL rtl_cipher_createARCFOUR (
234  rtlCipherMode Mode
236 
240 SAL_DLLPUBLIC rtlCipherError SAL_CALL rtl_cipher_initARCFOUR (
241  rtlCipher Cipher,
242  rtlCipherDirection Direction,
243  const sal_uInt8 *pKeyData, sal_Size nKeyLen,
244  const sal_uInt8 *pArgData, sal_Size nArgLen
246 
250 SAL_DLLPUBLIC rtlCipherError SAL_CALL rtl_cipher_encodeARCFOUR (
251  rtlCipher Cipher,
252  const void *pData, sal_Size nDatLen,
253  sal_uInt8 *pBuffer, sal_Size nBufLen
255 
259 SAL_DLLPUBLIC rtlCipherError SAL_CALL rtl_cipher_decodeARCFOUR (
260  rtlCipher Cipher,
261  const void *pData, sal_Size nDatLen,
262  sal_uInt8 *pBuffer, sal_Size nBufLen
264 
269  rtlCipher Cipher
271 
272 #ifdef __cplusplus
273 }
274 #endif
275 
276 #endif /* ! INCLUDED_RTL_CIPHER_H */
277 
278 /* 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:94
#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:95
__rtl_CipherDirection
Cipher Direction enumeration.
Definition: cipher.h:70
SAL_DLLPUBLIC void rtl_cipher_destroyARCFOUR(rtlCipher Cipher) SAL_THROW_EXTERN_C()
Destroy a RC4 cipher handle.
Definition: cipher.h:42
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:228
Definition: cipher.h:57
enum __rtl_CipherAlgorithm rtlCipherAlgorithm
Cipher Algorithm type.
Definition: cipher.h:49
SAL_DLLPUBLIC rtlCipher rtl_cipher_createBF(rtlCipherMode Mode) SAL_THROW_EXTERN_C()
Create a Blowfish cipher handle for the given mode.
Definition: cipher.h:56
void * rtlCipher
Cipher Handle opaque type.
Definition: cipher.h:34
Definition: cipher.h:60
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:45
enum __rtl_CipherDirection rtlCipherDirection
Cipher Direction type.
Definition: cipher.h:81
Definition: cipher.h:92
Definition: cipher.h:43
Definition: cipher.h:73
Definition: cipher.h:58
__rtl_CipherAlgorithm
Cipher Algorithm enumeration.
Definition: cipher.h:39
Definition: cipher.h:93
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:59
Definition: cipher.h:72
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:96
enum __rtl_CipherError rtlCipherError
Error Code type.
Definition: cipher.h:101
Definition: cipher.h:89
Definition: cipher.h:41
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:75
Definition: cipher.h:91
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:90
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:65
__rtl_CipherMode
Cipher Mode enumeration.
Definition: cipher.h:54
#define SAL_THROW_EXTERN_C()
Nothrow specification for C functions.
Definition: types.h:352
__rtl_CipherError
Error Code enumeration.
Definition: cipher.h:86
Definition: cipher.h:74
Definition: cipher.h:88