crypto: Remove unused code

pull/100/head
Andri Yngvason 2023-09-04 22:17:31 +00:00
parent f029484a87
commit d004a2fcb9
2 changed files with 0 additions and 27 deletions

View File

@ -65,11 +65,6 @@ ssize_t crypto_cipher_decrypt(struct crypto_cipher* self, uint8_t* dst,
uint8_t* mac, const uint8_t* src, size_t len,
const uint8_t* ad, size_t ad_len);
void crypto_cipher_set_ad(struct crypto_cipher* self, const uint8_t* ad,
size_t len);
void crypto_cipher_get_mac(struct crypto_cipher* self, uint8_t* dst,
size_t size);
// Hashing
struct crypto_hash* crypto_hash_new(enum crypto_hash_type type);
void crypto_hash_del(struct crypto_hash* self);

View File

@ -54,14 +54,6 @@ struct crypto_cipher {
struct crypto_aes256_eax aes256_eax;
} dec_ctx;
const uint8_t* ad;
size_t ad_len;
uint8_t mac[16];
uint8_t read_buffer[65536];
uint8_t read_buffer_len;
bool (*encrypt)(struct crypto_cipher*, struct vec* dst, uint8_t* mac,
const uint8_t* src, size_t src_len, const uint8_t* ad,
size_t ad_len);
@ -487,20 +479,6 @@ ssize_t crypto_cipher_decrypt(struct crypto_cipher* self, uint8_t* dst,
return self->decrypt(self, dst, mac, src, src_len, ad, ad_len);
}
void crypto_cipher_set_ad(struct crypto_cipher* self, const uint8_t* ad,
size_t len)
{
self->ad = ad;
self->ad_len = len;
}
void crypto_cipher_get_mac(struct crypto_cipher* self, uint8_t* dst,
size_t size)
{
size_t common_size = MIN(sizeof(self->mac), size);
memcpy(dst, self->mac, common_size);
}
struct crypto_hash* crypto_hash_new(enum crypto_hash_type type)
{
struct crypto_hash* self = calloc(1, sizeof(*self));