crypto: Remove unused code
parent
b7614f64a4
commit
b2ad06ae3c
|
@ -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,
|
uint8_t* mac, const uint8_t* src, size_t len,
|
||||||
const uint8_t* ad, size_t ad_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
|
// Hashing
|
||||||
struct crypto_hash* crypto_hash_new(enum crypto_hash_type type);
|
struct crypto_hash* crypto_hash_new(enum crypto_hash_type type);
|
||||||
void crypto_hash_del(struct crypto_hash* self);
|
void crypto_hash_del(struct crypto_hash* self);
|
||||||
|
|
|
@ -54,14 +54,6 @@ struct crypto_cipher {
|
||||||
struct crypto_aes256_eax aes256_eax;
|
struct crypto_aes256_eax aes256_eax;
|
||||||
} dec_ctx;
|
} 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,
|
bool (*encrypt)(struct crypto_cipher*, struct vec* dst, uint8_t* mac,
|
||||||
const uint8_t* src, size_t src_len, const uint8_t* ad,
|
const uint8_t* src, size_t src_len, const uint8_t* ad,
|
||||||
size_t ad_len);
|
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);
|
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* crypto_hash_new(enum crypto_hash_type type)
|
||||||
{
|
{
|
||||||
struct crypto_hash* self = calloc(1, sizeof(*self));
|
struct crypto_hash* self = calloc(1, sizeof(*self));
|
||||||
|
|
Loading…
Reference in New Issue