diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2013-11-20 01:51:12 +0100 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2013-11-20 01:51:12 +0100 |
commit | b5112ff67f3dd5bb263f5ca6283f170906acaab6 (patch) | |
tree | b1b3974a9e4ae986c516c53ae723df1c2057974d /src/fastd.h | |
parent | 9bb8a04e288d3df817a4328cce9e0ef8f96a0600 (diff) | |
download | fastd-b5112ff67f3dd5bb263f5ca6283f170906acaab6.tar fastd-b5112ff67f3dd5bb263f5ca6283f170906acaab6.zip |
Slightly simplify method/cipher/MAC definitions
Diffstat (limited to 'src/fastd.h')
-rw-r--r-- | src/fastd.h | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/fastd.h b/src/fastd.h index 5354871..2536e71 100644 --- a/src/fastd.h +++ b/src/fastd.h @@ -82,10 +82,10 @@ struct fastd_method { bool (*provides)(const char *name); size_t (*max_packet_size)(fastd_context_t *ctx); - size_t (*min_encrypt_head_space)(fastd_context_t *ctx); - size_t (*min_decrypt_head_space)(fastd_context_t *ctx); - size_t (*min_encrypt_tail_space)(fastd_context_t *ctx); - size_t (*min_decrypt_tail_space)(fastd_context_t *ctx); + size_t min_encrypt_head_space; + size_t min_decrypt_head_space; + size_t min_encrypt_tail_space; + size_t min_decrypt_tail_space; size_t (*key_length)(fastd_context_t *ctx, const char *name); fastd_method_session_state_t* (*session_init)(fastd_context_t *ctx, const char *name, const uint8_t *secret, bool initiator); @@ -102,13 +102,12 @@ struct fastd_method { struct fastd_cipher { const char *name; + size_t key_length; + size_t iv_length; fastd_cipher_context_t* (*initialize)(fastd_context_t *ctx); - - size_t (*key_length)(fastd_context_t *ctx, const fastd_cipher_context_t *cctx); fastd_cipher_state_t* (*init_state)(fastd_context_t *ctx, const fastd_cipher_context_t *cctx, const uint8_t *key); - size_t (*iv_length)(fastd_context_t *ctx, const fastd_cipher_state_t *state); bool (*crypt)(fastd_context_t *ctx, const fastd_cipher_state_t *state, fastd_block128_t *out, const fastd_block128_t *in, size_t len, const uint8_t *iv); void (*free_state)(fastd_context_t *ctx, fastd_cipher_state_t *state); @@ -117,10 +116,9 @@ struct fastd_cipher { struct fastd_mac { const char *name; + size_t key_length; fastd_mac_context_t* (*initialize)(fastd_context_t *ctx); - - size_t (*key_length)(fastd_context_t *ctx, const fastd_mac_context_t *mctx); fastd_mac_state_t* (*init_state)(fastd_context_t *ctx, const fastd_mac_context_t *mctx, const uint8_t *key); bool (*hash)(fastd_context_t *ctx, const fastd_mac_state_t *state, fastd_block128_t *out, const fastd_block128_t *in, size_t n_blocks); |