forked from ElektraInitiative/libelektra
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgcrypt_operations.h
More file actions
31 lines (25 loc) · 1 KB
/
Copy pathgcrypt_operations.h
File metadata and controls
31 lines (25 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/**
* @file
*
* @brief cryptographic interface using the gcrypt library
*
* @copyright BSD License (see LICENSE.md or https://www.libelektra.org)
*
*/
#ifndef ELEKTRA_PLUGIN_GCRYPT_OPERATIONS_H
#define ELEKTRA_PLUGIN_GCRYPT_OPERATIONS_H
#include <kdb.h>
#include <kdbtypes.h>
// gcrypt specific declarations
#include <gcrypt.h>
typedef gcry_cipher_hd_t elektraCryptoHandle;
#define ELEKTRA_CRYPTO_GCRY_KEYSIZE (32)
#define ELEKTRA_CRYPTO_GCRY_BLOCKSIZE (16)
char * elektraCryptoGcryCreateRandomString (Key * errorKey, const kdb_unsigned_short_t length);
int elektraCryptoGcryInit (Key * errorKey);
int elektraCryptoGcryHandleCreate (elektraCryptoHandle ** handle, KeySet * config, Key * errorKey, Key * masterKey, Key * k,
const enum ElektraCryptoOperation op);
void elektraCryptoGcryHandleDestroy (elektraCryptoHandle * handle);
int elektraCryptoGcryEncrypt (elektraCryptoHandle * handle, Key * k, Key * errorKey);
int elektraCryptoGcryDecrypt (elektraCryptoHandle * handle, Key * k, Key * errorKey);
#endif