/* ecrypt-sync-ae.h */ /* * Header file for synchronous stream ciphers with authentication * mechanism. * * *** Please only edit parts marked with "[edit]". *** */ #ifndef ECRYPT_SYNC_AE #define ECRYPT_SYNC_AE #include "ecrypt-portable.h" /* ------------------------------------------------------------------------- */ /* Cipher parameters */ /* * The name of your cipher. */ #define ECRYPT_NAME "Frogbit" #define ECRYPT_PROFILE "_____" /* * Specify which key, IV, and MAC sizes are supported by your * cipher. A user should be able to enumerate the supported sizes by * running the following code: * * for (i = 0; ECRYPT_KEYSIZE(i) <= ECRYPT_MAXKEYSIZE; ++i) * { * keysize = ECRYPT_KEYSIZE(i); * * ... * } * * All sizes are in bits. */ #define ECRYPT_MAXKEYSIZE 128 #define ECRYPT_KEYSIZE(i) (128 + (i)*64) #define ECRYPT_MAXIVSIZE 128 #define ECRYPT_IVSIZE(i) (64 + (i)*64) #define ECRYPT_MAXMACSIZE 128 #define ECRYPT_MACSIZE(i) (32 + (i)*32) /* ------------------------------------------------------------------------- */ /* Data structures */ /* * ECRYPT_AE_ctx is the structure containing the representation of the * internal state of your cipher. * * If your cipher also supports unauthenticated encryption, and you * want to allow the user to call the unauthenticated functions * declared in "ecrypt-sync.h" as well, you might want to set the * ECRYPT_SUPPORTS_UAE flag and define the ECRYPT_AE_ctx context as an * extension of the ECRYPT_ctx structure defined in "ecrypt-sync.h". */ #undef ECRYPT_SUPPORTS_UAE #ifndef ECRYPT_SUPPORTS_UAE /* Some Frogbit parameters */ #define FROGBIT10 (10) #define FROGBIT_MAC_SECRETLEN (32) #if !defined(MTGFSR_F) /* Some MTGFSR parameters */ #define MTGFSR_F (2) #define MTGFSR_siz (4) typedef struct { int ind; u32 bits[MTGFSR_siz]; u32 table[1< ECRYPT_MAXVARIANT) #error this variant does not exist #endif /* ------------------------------------------------------------------------- */ #endif