DynXX-C
Loading...
Searching...
No Matches
Crypto.h
Go to the documentation of this file.
1#pragma once
2
3#include "Types.h"
4
6
12const byte *dynxx_crypto_rand(size_t len);
13
23const byte *dynxx_crypto_aes_encrypt(const byte *inBytes, size_t inLen, const byte *keyBytes, size_t keyLen,
24 DYNXX_OUT size_t *outLen);
25
35const byte *dynxx_crypto_aes_decrypt(const byte *inBytes, size_t inLen, const byte *keyBytes, size_t keyLen,
36 DYNXX_OUT size_t *outLen);
37
52const byte *dynxx_crypto_aes_gcm_encrypt(const byte *inBytes, size_t inLen,
53 const byte *keyBytes, size_t keyLen,
54 const byte *initVectorBytes, size_t initVectorLen,
55 const byte *aadBytes, size_t aadLen,
56 size_t tagBits,
57 DYNXX_OUT size_t *outLen);
58
73const byte *dynxx_crypto_aes_gcm_decrypt(const byte *inBytes, size_t inLen,
74 const byte *keyBytes, size_t keyLen,
75 const byte *initVectorBytes, size_t initVectorLen,
76 const byte *aadBytes, size_t aadLen,
77 size_t tagBits,
78 DYNXX_OUT size_t *outLen);
79
91
92const char *dynxx_crypto_rsa_gen_key(const char *base64, bool isPublic);
93
104const byte *dynxx_crypto_rsa_encrypt(const byte *inBytes, size_t inLen,
105 const byte *keyBytes, size_t keyLen, DynXXCryptoRSAPadding padding,
106 DYNXX_OUT size_t *outLen);
107
118const byte *dynxx_crypto_rsa_decrypt(const byte *inBytes, size_t inLen,
119 const byte *keyBytes, size_t keyLen, DynXXCryptoRSAPadding padding,
120 DYNXX_OUT size_t *outLen);
121
129const byte *dynxx_crypto_hash_md5(const byte *inBytes, size_t inLen, DYNXX_OUT size_t *outLen);
130
138const byte *dynxx_crypto_hash_sha1(const byte *inBytes, size_t inLen, DYNXX_OUT size_t *outLen);
139
147const byte *dynxx_crypto_hash_sha256(const byte *inBytes, size_t inLen, DYNXX_OUT size_t *outLen);
148
157const byte *dynxx_crypto_base64_encode(const byte *inBytes, size_t inLen, bool noNewLines, DYNXX_OUT size_t *outLen);
158
167const byte *dynxx_crypto_base64_decode(const byte *inBytes, size_t inLen, bool noNewLines, DYNXX_OUT size_t *outLen);
168
DYNXX_EXTERN_C_BEGIN const byte * dynxx_crypto_rand(size_t len)
Generate random bytes.
const byte * dynxx_crypto_hash_md5(const byte *inBytes, size_t inLen, DYNXX_OUT size_t *outLen)
MD5 hash.
const byte * dynxx_crypto_base64_encode(const byte *inBytes, size_t inLen, bool noNewLines, DYNXX_OUT size_t *outLen)
Base64 encode.
const byte * dynxx_crypto_aes_encrypt(const byte *inBytes, size_t inLen, const byte *keyBytes, size_t keyLen, DYNXX_OUT size_t *outLen)
AES Encrypt.
const byte * dynxx_crypto_hash_sha1(const byte *inBytes, size_t inLen, DYNXX_OUT size_t *outLen)
SHA1.
const byte * dynxx_crypto_aes_gcm_decrypt(const byte *inBytes, size_t inLen, const byte *keyBytes, size_t keyLen, const byte *initVectorBytes, size_t initVectorLen, const byte *aadBytes, size_t aadLen, size_t tagBits, DYNXX_OUT size_t *outLen)
AES GCM Decrypt.
const byte * dynxx_crypto_base64_decode(const byte *inBytes, size_t inLen, bool noNewLines, DYNXX_OUT size_t *outLen)
Base64 decode.
const byte * dynxx_crypto_rsa_encrypt(const byte *inBytes, size_t inLen, const byte *keyBytes, size_t keyLen, DynXXCryptoRSAPadding padding, DYNXX_OUT size_t *outLen)
RSA Encrypt.
const byte * dynxx_crypto_rsa_decrypt(const byte *inBytes, size_t inLen, const byte *keyBytes, size_t keyLen, DynXXCryptoRSAPadding padding, DYNXX_OUT size_t *outLen)
RSA Decrypt.
const byte * dynxx_crypto_aes_gcm_encrypt(const byte *inBytes, size_t inLen, const byte *keyBytes, size_t keyLen, const byte *initVectorBytes, size_t initVectorLen, const byte *aadBytes, size_t aadLen, size_t tagBits, DYNXX_OUT size_t *outLen)
AES GCM Encrypt.
DynXXCryptoRSAPadding
RSA padding.
Definition Crypto.h:83
@ DynXXCryptoRSAPaddingSSLV23
Definition Crypto.h:85
@ DynXXCryptoRSAPaddingNO
Definition Crypto.h:86
@ DynXXCryptoRSAPaddingPKCS1_OAEP
Definition Crypto.h:87
@ DynXXCryptoRSAPaddingPKCS1_PSS
Definition Crypto.h:89
@ DynXXCryptoRSAPaddingPKCS1
Definition Crypto.h:84
@ DynXXCryptoRSAPaddingX931
Definition Crypto.h:88
const char * dynxx_crypto_rsa_gen_key(const char *base64, bool isPublic)
const byte * dynxx_crypto_aes_decrypt(const byte *inBytes, size_t inLen, const byte *keyBytes, size_t keyLen, DYNXX_OUT size_t *outLen)
AES Decrypt.
const byte * dynxx_crypto_hash_sha256(const byte *inBytes, size_t inLen, DYNXX_OUT size_t *outLen)
SHA256.
#define DYNXX_EXTERN_C_BEGIN
Definition Macro.h:13
#define DYNXX_EXTERN_C_END
Definition Macro.h:14
#define DYNXX_OUT
Definition Macro.h:38