diff --git a/include/crypto.h b/include/crypto.h index 9dcd08a..ae89de2 100644 --- a/include/crypto.h +++ b/include/crypto.h @@ -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); diff --git a/src/crypto-nettle.c b/src/crypto-nettle.c index 3204ed0..7e7f90b 100644 --- a/src/crypto-nettle.c +++ b/src/crypto-nettle.c @@ -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));