| /* |
/* |
| * The name of your cipher. |
* The name of your cipher. |
| */ |
*/ |
| #define ECRYPT_NAME "ABC" /* [edit] */ |
#define ECRYPT_NAME "ABC-v1" /* [edit] */ |
| |
#define ECRYPT_PROFILE "S.___" |
| |
|
| /* |
/* |
| * Specify which key and IV sizes are supported by your cipher. A user |
* Specify which key and IV sizes are supported by your cipher. A user |
| * internal state of ABC cipher. |
* internal state of ABC cipher. |
| */ |
*/ |
| |
|
| |
/* |
| |
* NOTE: ECRYPT_VARIANT is not supposed to affect the external |
| |
* interface in any way. The definitions below violate this rule, but |
| |
* since the test suite does not rely on it at this stage, we leave it |
| |
* this way. |
| |
*/ |
| |
|
| typedef struct |
typedef struct |
| { |
{ |
| u32 z0, z1; /* A primitive (LFSR) state */ |
u32 z0, z1; /* A primitive (LFSR) state */ |
| u32 z0i, z1i; /* A state right after key setup */ |
u32 z0i, z1i; /* A state right after key setup */ |
| u32 xi; /* B state right after key setup */ |
u32 xi; /* B state right after key setup */ |
| u32 d0i, d1i; /* B coefs after key setup */ |
u32 d0i, d1i; /* B coefs after key setup */ |
| #ifndef ECRYPT_API |
#if (ECRYPT_VARIANT >= 10) |
| #if (ECRYPT_VARIANT == 0) |
|
| u32 t[33]; /* C primitive coefficients */ |
u32 t[33]; /* C primitive coefficients */ |
| #elif (ECRYPT_VARIANT > 0) && (ECRYPT_VARIANT < 3) |
#elif (ECRYPT_VARIANT >= 8) |
| u32 t[64]; /* Optimization table for 2-bit window */ |
u32 t[64]; /* Optimization table for 2-bit window */ |
| #elif (ECRYPT_VARIANT >= 3) && (ECRYPT_VARIANT < 6) |
#elif (ECRYPT_VARIANT >= 5) |
| u32 t[128]; /* Optimization table for 4-bit window */ |
u32 t[128]; /* Optimization table for 4-bit window */ |
| #elif (ECRYPT_VARIANT >= 6) && (ECRYPT_VARIANT < 9) |
#elif (ECRYPT_VARIANT >= 2) |
| u32 t[1024]; /* Optimization table for 8-bit window */ |
u32 t[1024]; /* Optimization table for 8-bit window */ |
| #elif (ECRYPT_VARIANT == 9) |
#elif (ECRYPT_VARIANT >= 1) || !defined(ECRYPT_VARIANT) |
| u32 t[8448]; /* Optimization table for 12-12-8-bit windows */ |
|
| #endif |
|
| #else |
|
| u32 t[8448]; /* Optimization table for 12-12-8-bit windows */ |
u32 t[8448]; /* Optimization table for 12-12-8-bit windows */ |
| #endif |
#endif |
| } ECRYPT_ctx; |
} ECRYPT_ctx; |
| * 10). Note also that all variants should have exactly the same |
* 10). Note also that all variants should have exactly the same |
| * external interface (i.e., the same ECRYPT_BLOCKLENGTH, etc.). |
* external interface (i.e., the same ECRYPT_BLOCKLENGTH, etc.). |
| */ |
*/ |
| #define ECRYPT_MAXVARIANT 9 /* [edit] */ |
#define ECRYPT_MAXVARIANT 10 /* [edit] */ |
| |
|
| #ifndef ECRYPT_VARIANT |
#ifndef ECRYPT_VARIANT |
| #define ECRYPT_VARIANT 1 |
#define ECRYPT_VARIANT 1 |