diff options
Diffstat (limited to 'src/cipher.h')
-rw-r--r-- | src/cipher.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/cipher.h b/src/cipher.h index 5b750b9..036eb72 100644 --- a/src/cipher.h +++ b/src/cipher.h @@ -35,8 +35,12 @@ #ifndef _CIPHER_H_ #define _CIPHER_H_ +#ifndef NO_CRYPT #include <gcrypt.h> #include "key_derivation.h" +#else +typedef u_int8_t* key_derivation_t; +#endif enum cipher_type_enum { c_unknown, c_null, c_aes_ctr }; typedef enum cipher_type_enum cipher_type_t; @@ -46,7 +50,9 @@ struct cipher_struct { u_int16_t key_length_; buffer_t key_; buffer_t salt_; +#ifndef NO_CRYPT gcry_cipher_hd_t handle_; +#endif }; typedef struct cipher_struct cipher_t; @@ -58,9 +64,12 @@ int cipher_decrypt(cipher_t* c, key_derivation_t* kd, encrypted_packet_t* in, pl int32_t cipher_null_crypt(u_int8_t* in, u_int32_t ilen, u_int8_t* out, u_int32_t olen); + +#ifndef NO_CRYPT int cipher_aesctr_init(cipher_t* c); void cipher_aesctr_close(cipher_t* c); buffer_t cipher_aesctr_calc_ctr(cipher_t* c, key_derivation_t* kd, seq_nr_t seq_nr, sender_id_t sender_id, mux_t mux); int32_t cipher_aesctr_crypt(cipher_t* c, key_derivation_t* kd, u_int8_t* in, u_int32_t ilen, u_int8_t* out, u_int32_t olen, seq_nr_t seq_nr, sender_id_t sender_id, mux_t mux); +#endif #endif |