2 #include "ypc/corecommon/crypto/aes_gcm_traits.h"
8 #define INITIALIZATION_VECTOR_SIZE 12
11 static inline uint32_t get_mac_code_size() {
return 16; }
12 static inline uint32_t get_cipher_size(uint32_t data_size) {
13 return data_size + INITIALIZATION_VECTOR_SIZE;
15 static inline uint32_t get_data_size(uint32_t cipher_size) {
16 return cipher_size - INITIALIZATION_VECTOR_SIZE;
18 static inline uint32_t get_key_size() {
return 16; }
20 static uint32_t encrypt_with_prefix(
const uint8_t *key, uint32_t key_size,
21 const uint8_t *data, uint32_t data_size,
22 uint32_t prefix, uint8_t *cipher,
23 uint32_t cipher_size, uint8_t *out_mac);
25 static uint32_t decrypt_with_prefix(
const uint8_t *key, uint32_t key_size,
26 const uint8_t *cipher,
27 uint32_t cipher_size, uint32_t prefix,
28 uint8_t *data, uint32_t data_size,
29 const uint8_t *in_mac);
32 constexpr
static bool value =
true;