17 #ifndef KAA_AES_RSA_H_
18 #define KAA_AES_RSA_H_
22 #include <mbedtls/pk.h>
23 #include <mbedtls/entropy.h>
24 #include <mbedtls/ctr_drbg.h>
25 #include <mbedtls/md.h>
31 #define KAA_SESSION_KEY_LENGTH 16
54 uint8_t *output,
const uint8_t *key);
77 int rsa_sign(mbedtls_pk_context *pk,
const uint8_t *input,
size_t input_size,
78 uint8_t *output,
size_t *output_size);
95 size_t input_len, uint8_t *output);
kaa_error_t aes_encrypt_decrypt(int mode, const uint8_t *input, size_t input_size, uint8_t *output, const uint8_t *key)
Encrypt or decrypt with AES key.
kaa_error_t rsa_encrypt(const uint8_t *key, size_t key_size, const uint8_t *input, size_t input_len, uint8_t *output)
Encrypt data with pubcic RSA key.
kaa_error_t
Definition: kaa_error.h:31
kaa_error_t aes_encrypt_decrypt_block(int mode, const uint8_t *input, uint8_t *output, const uint8_t *key)
Encrypt or decrypt block of size KAA_SESSION_KEY_LENGTH with AES key.
int rsa_sign(mbedtls_pk_context *pk, const uint8_t *input, size_t input_size, uint8_t *output, size_t *output_size)
Create RSA signature.
int init_aes_key(unsigned char *key, size_t bytes)
Generate AES key.