oxedyne/fe2o3/fe2o3_crypto/src/c/SABER_params.h
1.3 KiB, 1 run
created by r1870400018:175, which is this file's identity for as long as the history lasts, whatever it is later renamed to
download · who wrote it · its history
| 1 | #ifndef PARAMS_H |
| 2 | #define PARAMS_H |
| 3 | |
| 4 | /* Uncomment one of these to select desired scheme */ |
| 5 | #define SABER_L 2 /* LightSaber */ |
| 6 | //#define SABER_L 3 /* Saber */ |
| 7 | //#define SABER_L 4 /* FireSaber */ |
| 8 | |
| 9 | /* Don't change anything below this line */ |
| 10 | #if SABER_L == 2 |
| 11 | #define SABER_MU 10 |
| 12 | #define SABER_ET 3 |
| 13 | #elif SABER_L == 3 |
| 14 | #define SABER_MU 8 |
| 15 | #define SABER_ET 4 |
| 16 | #elif SABER_L == 4 |
| 17 | #define SABER_MU 6 |
| 18 | #define SABER_ET 6 |
| 19 | #endif |
| 20 | |
| 21 | #define SABER_EQ 13 |
| 22 | #define SABER_EP 10 |
| 23 | #define SABER_N 256 |
| 24 | |
| 25 | #define SABER_SEEDBYTES 32 |
| 26 | #define SABER_NOISE_SEEDBYTES 32 |
| 27 | #define SABER_KEYBYTES 32 |
| 28 | #define SABER_HASHBYTES 32 |
| 29 | |
| 30 | #define SABER_POLYCOINBYTES (SABER_MU * SABER_N / 8) |
| 31 | |
| 32 | #define SABER_POLYBYTES (SABER_EQ * SABER_N / 8) |
| 33 | #define SABER_POLYVECBYTES (SABER_L * SABER_POLYBYTES) |
| 34 | |
| 35 | #define SABER_POLYCOMPRESSEDBYTES (SABER_EP * SABER_N / 8) |
| 36 | #define SABER_POLYVECCOMPRESSEDBYTES (SABER_L * SABER_POLYCOMPRESSEDBYTES) |
| 37 | |
| 38 | #define SABER_SCALEBYTES_KEM (SABER_ET * SABER_N / 8) |
| 39 | |
| 40 | #define SABER_INDCPA_PUBLICKEYBYTES (SABER_POLYVECCOMPRESSEDBYTES + SABER_SEEDBYTES) |
| 41 | #define SABER_INDCPA_SECRETKEYBYTES (SABER_POLYVECBYTES) |
| 42 | |
| 43 | #define SABER_PUBLICKEYBYTES (SABER_INDCPA_PUBLICKEYBYTES) |
| 44 | #define SABER_SECRETKEYBYTES (SABER_INDCPA_SECRETKEYBYTES + SABER_INDCPA_PUBLICKEYBYTES + SABER_HASHBYTES + SABER_KEYBYTES) |
| 45 | |
| 46 | #define SABER_BYTES_CCA_DEC (SABER_POLYVECCOMPRESSEDBYTES + SABER_SCALEBYTES_KEM) |
| 47 | |
| 48 | #endif |