schwaemmconfig.h 1.85 KB
Newer Older
lwc-tester committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
#ifndef SCHWAEMMCONFIG_H
#define SCHWAEMMCONFIG_H

//Define the version SCHWAEMM here. Notice that api.h must match.
#define SCHWAEMM128_128

//sizes are given in bits. For use in the code, util.h defines BYTE and WORD
//macros for on-the-fly conversion.

#define CRYPTO_KEYWORDS (CRYPTO_KEYBYTES/4)
#define CRYPTO_NPUBWORDS (CRYPTO_NPUBBYTES/4)


#if defined SCHWAEMM256_128

    #define STATESIZE 384
    #define RATE 256
    #define CAPACITY 128
    #define STEPSSLIM 7
    #define STEPSBIG 11
    #define B 3

    #define   PADADCONST (0 ^ (1 << 2)) /* 4 */
    #define NOPADADCONST (1 ^ (1 << 2)) /* 5 */
    #define   PADPTCONST (2 ^ (1 << 2)) /* 6 */
    #define NOPADPTCONST (3 ^ (1 << 2)) /* 7 */

#elif defined SCHWAEMM192_192

    #define STATESIZE 384
    #define RATE 192
    #define CAPACITY 192
    #define STEPSSLIM 7
    #define STEPSBIG 11
    #define B 3

    #define   PADADCONST (0 ^ (1 << 3)) /* 8 */
    #define NOPADADCONST (1 ^ (1 << 3)) /* 9 */
    #define   PADPTCONST (2 ^ (1 << 3)) /* 10 */
    #define NOPADPTCONST (3 ^ (1 << 3)) /* 11 */

#elif defined SCHWAEMM128_128

    #define STATESIZE 256
    #define RATE 128
    #define CAPACITY 128
    #define STEPSSLIM 7
    #define STEPSBIG 10
    #define B 2

    #define   PADADCONST (0 ^ (1 << 2)) /* 4 */
    #define NOPADADCONST (1 ^ (1 << 2)) /* 5 */
    #define   PADPTCONST (2 ^ (1 << 2)) /* 6 */
    #define NOPADPTCONST (3 ^ (1 << 2)) /* 7 */

#elif defined SCHWAEMM256_256

    #define STATESIZE 512
    #define RATE 256
    #define CAPACITY 256
    #define STEPSSLIM 8
    #define STEPSBIG 12
    #define B 4

    #define   PADADCONST (0 ^ (1 << 4)) /* 16 */
    #define NOPADADCONST (1 ^ (1 << 4)) /* 17 */
    #define   PADPTCONST (2 ^ (1 << 4)) /* 18 */
    #define NOPADPTCONST (3 ^ (1 << 4)) /* 19 */
#else
    #error "Invalid definition of algorithm instance."
#endif

#endif /*SCHWAEMMCONFIG_H*/