diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2013-11-02 04:32:18 +0100 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2013-11-02 04:32:18 +0100 |
commit | 20ee3b5a4f110f53a73746e18fc0eb0cbbb7845c (patch) | |
tree | bbf62cb65ba716e7cefcfc41904bb3460c3ddb58 /src/types.h | |
parent | de66ca829d22f939900635968d1b3fd7a7d598da (diff) | |
download | fastd-20ee3b5a4f110f53a73746e18fc0eb0cbbb7845c.tar fastd-20ee3b5a4f110f53a73746e18fc0eb0cbbb7845c.zip |
Implement the first step towards a more flexible way to support crypto methods
Diffstat (limited to 'src/types.h')
-rw-r--r-- | src/types.h | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/types.h b/src/types.h index a2b7d38..894b2af 100644 --- a/src/types.h +++ b/src/types.h @@ -36,6 +36,7 @@ #include <fastd_config.h> #include <stdbool.h> +#include <stdint.h> #define UNUSED __attribute__((unused)) @@ -113,6 +114,7 @@ typedef struct fastd_context fastd_context_t; typedef struct fastd_protocol fastd_protocol_t; typedef struct fastd_method fastd_method_t; +typedef struct fastd_cipher fastd_cipher_t; typedef struct fastd_handshake fastd_handshake_t; @@ -121,14 +123,17 @@ typedef struct fastd_string_stack fastd_string_stack_t; typedef struct fastd_resolve_return fastd_resolve_return_t; -#ifdef USE_CRYPTO_AES128CTR -typedef struct fastd_crypto_aes128ctr fastd_crypto_aes128ctr_t; -#endif #ifdef USE_CRYPTO_GHASH typedef struct fastd_crypto_ghash fastd_crypto_ghash_t; #endif +typedef union fastd_block128 { + uint8_t b[16]; + uint64_t qw[2]; +} __attribute__((aligned(16))) fastd_block128_t; + + /* May be defined by the protocol/method/crypto implementations however they like */ typedef struct fastd_protocol_config fastd_protocol_config_t; typedef struct fastd_protocol_state fastd_protocol_state_t; @@ -137,10 +142,8 @@ typedef struct fastd_protocol_peer_state fastd_protocol_peer_state_t; typedef struct fastd_method_session_state fastd_method_session_state_t; -#ifdef USE_CRYPTO_AES128CTR -typedef struct fastd_crypto_aes128ctr_context fastd_crypto_aes128ctr_context_t; -typedef struct fastd_crypto_aes128ctr_state fastd_crypto_aes128ctr_state_t; -#endif +typedef struct fastd_cipher_context fastd_cipher_context_t; +typedef struct fastd_cipher_state fastd_cipher_state_t; #ifdef USE_CRYPTO_GHASH typedef struct fastd_crypto_ghash_context fastd_crypto_ghash_context_t; |