crypto: use void* args for aes_siv_{encrypt,decrypt}

This makes these APIs more flexible for other storage types
This commit is contained in:
James Prestwood 2021-11-22 12:44:22 -08:00 committed by Denis Kenzior
parent 88c786093b
commit b735c90c42
2 changed files with 8 additions and 8 deletions

View File

@ -321,9 +321,9 @@ static bool s2v(struct l_checksum *cmac, struct iovec *iov, size_t iov_len,
/*
* RFC 5297 Section 2.6 - SIV Encrypt
*/
bool aes_siv_encrypt(const uint8_t *key, size_t key_len, const uint8_t *in,
bool aes_siv_encrypt(const void *key, size_t key_len, const void *in,
size_t in_len, struct iovec *ad, size_t num_ad,
uint8_t *out)
void *out)
{
struct l_checksum *cmac;
struct l_cipher *ctr;
@ -374,9 +374,9 @@ free_ctr:
return false;
}
bool aes_siv_decrypt(const uint8_t *key, size_t key_len, const uint8_t *in,
bool aes_siv_decrypt(const void *key, size_t key_len, const void *in,
size_t in_len, struct iovec *ad, size_t num_ad,
uint8_t *out)
void *out)
{
struct l_checksum *cmac;
struct l_cipher *ctr;

View File

@ -83,12 +83,12 @@ bool aes_wrap(const uint8_t *kek, const uint8_t *in, size_t len, uint8_t *out);
bool arc4_skip(const uint8_t *key, size_t key_len, size_t skip,
const uint8_t *in, size_t len, uint8_t *out);
bool aes_siv_encrypt(const uint8_t *key, size_t key_len, const uint8_t *in,
bool aes_siv_encrypt(const void *key, size_t key_len, const void *in,
size_t in_len, struct iovec *ad, size_t num_ad,
uint8_t *out);
bool aes_siv_decrypt(const uint8_t *key, size_t key_len, const uint8_t *in,
void *out);
bool aes_siv_decrypt(const void *key, size_t key_len, const void *in,
size_t in_len, struct iovec *ad, size_t num_ad,
uint8_t *out);
void *out);
int crypto_cipher_key_len(enum crypto_cipher cipher);
int crypto_cipher_tk_bits(enum crypto_cipher cipher);