fips203ipd
C11 implementation of FIPS 203 initial public draft (IPD).
fips203ipd.h
Go to the documentation of this file.
1
15#ifndef FIPS203IPD_H
16#define FIPS203IPD_H
17
18#include <stdint.h> // uint8_t
19
39#define FIPS203IPD_KEYGEN_SEED_SIZE 64
40
56#define FIPS203IPD_ENCAPS_SEED_SIZE 32
57
62#define FIPS203IPD_KEY_SIZE 32
63
73#define FIPS203IPD_KEM512_EK_SIZE 800
74
79#define FIPS203IPD_KEM512_DK_SIZE 1632
80
85#define FIPS203IPD_KEM512_CT_SIZE 768
86
110void fips203ipd_kem512_keygen(uint8_t ek[static FIPS203IPD_KEM512_EK_SIZE], uint8_t dk[static FIPS203IPD_KEM512_DK_SIZE], const uint8_t seed[static FIPS203IPD_KEYGEN_SEED_SIZE]);
111
141void fips203ipd_kem512_encaps(uint8_t key[static FIPS203IPD_KEY_SIZE], uint8_t ct[static FIPS203IPD_KEM512_CT_SIZE], const uint8_t ek[static FIPS203IPD_KEM512_EK_SIZE], const uint8_t seed[static FIPS203IPD_ENCAPS_SEED_SIZE]);
142
166void fips203ipd_kem512_decaps(uint8_t key[static FIPS203IPD_KEY_SIZE], const uint8_t ct[static FIPS203IPD_KEM512_CT_SIZE], const uint8_t dk[static FIPS203IPD_KEM512_DK_SIZE]);
167
177#define FIPS203IPD_KEM768_EK_SIZE 1184
178
183#define FIPS203IPD_KEM768_DK_SIZE 2400
184
189#define FIPS203IPD_KEM768_CT_SIZE 1088
190
214void fips203ipd_kem768_keygen(uint8_t ek[static FIPS203IPD_KEM768_EK_SIZE], uint8_t dk[static FIPS203IPD_KEM768_DK_SIZE], const uint8_t seed[static FIPS203IPD_KEYGEN_SEED_SIZE]);
215
245void fips203ipd_kem768_encaps(uint8_t key[static FIPS203IPD_KEY_SIZE], uint8_t ct[static FIPS203IPD_KEM768_CT_SIZE], const uint8_t ek[static FIPS203IPD_KEM768_EK_SIZE], const uint8_t seed[static FIPS203IPD_ENCAPS_SEED_SIZE]);
246
270void fips203ipd_kem768_decaps(uint8_t key[static FIPS203IPD_KEY_SIZE], const uint8_t ct[static FIPS203IPD_KEM768_CT_SIZE], const uint8_t dk[static FIPS203IPD_KEM768_DK_SIZE]);
271
281#define FIPS203IPD_KEM1024_EK_SIZE 1568
282
287#define FIPS203IPD_KEM1024_DK_SIZE 3168
288
293#define FIPS203IPD_KEM1024_CT_SIZE 1568
294
318void fips203ipd_kem1024_keygen(uint8_t ek[static FIPS203IPD_KEM1024_EK_SIZE], uint8_t dk[static FIPS203IPD_KEM1024_DK_SIZE], const uint8_t seed[static FIPS203IPD_KEYGEN_SEED_SIZE]);
319
349void fips203ipd_kem1024_encaps(uint8_t key[static FIPS203IPD_KEY_SIZE], uint8_t ct[static FIPS203IPD_KEM1024_CT_SIZE], const uint8_t ek[static FIPS203IPD_KEM1024_EK_SIZE], const uint8_t seed[static FIPS203IPD_ENCAPS_SEED_SIZE]);
350
374void fips203ipd_kem1024_decaps(uint8_t key[static FIPS203IPD_KEY_SIZE], const uint8_t ct[static FIPS203IPD_KEM1024_CT_SIZE], const uint8_t dk[static FIPS203IPD_KEM1024_DK_SIZE]);
375
376#endif /* FIPS203IPD_H */
#define FIPS203IPD_KEM1024_CT_SIZE
Size of KEM1024 ciphertext, in bytes (32 * (DU * K + DV)).
Definition: fips203ipd.h:293
#define FIPS203IPD_KEM1024_EK_SIZE
Size of KEM1024 encapsulation key, in bytes (384 * K + 32).
Definition: fips203ipd.h:281
#define FIPS203IPD_KEM1024_DK_SIZE
Size of KEM1024 decapsulation key, in bytes (768 * K + 96).
Definition: fips203ipd.h:287
void fips203ipd_kem1024_encaps(uint8_t key[static FIPS203IPD_KEY_SIZE], uint8_t ct[static FIPS203IPD_KEM1024_CT_SIZE], const uint8_t ek[static FIPS203IPD_KEM1024_EK_SIZE], const uint8_t seed[static FIPS203IPD_ENCAPS_SEED_SIZE])
Generate KEM1024 shared key key and ciphertext ct from given encapsulation key ek and randomness seed...
void fips203ipd_kem1024_keygen(uint8_t ek[static FIPS203IPD_KEM1024_EK_SIZE], uint8_t dk[static FIPS203IPD_KEM1024_DK_SIZE], const uint8_t seed[static FIPS203IPD_KEYGEN_SEED_SIZE])
Generate KEM1024 encapsulation key ek and decapsulation key dk from 64 byte random seed seed.
void fips203ipd_kem1024_decaps(uint8_t key[static FIPS203IPD_KEY_SIZE], const uint8_t ct[static FIPS203IPD_KEM1024_CT_SIZE], const uint8_t dk[static FIPS203IPD_KEM1024_DK_SIZE])
Decapsulate shared key key from ciphertext ct using KEM1024 decapsulation key dk with implicit reject...
#define FIPS203IPD_KEM512_DK_SIZE
Size of KEM512 decapsulation key, in bytes (768 * K + 96).
Definition: fips203ipd.h:79
#define FIPS203IPD_KEM512_CT_SIZE
Size of KEM512 ciphertext, in bytes (32 * (DU * K + DV)).
Definition: fips203ipd.h:85
#define FIPS203IPD_KEM512_EK_SIZE
Size of KEM512 encapsulation key, in bytes (384 * K + 32).
Definition: fips203ipd.h:73
void fips203ipd_kem512_keygen(uint8_t ek[static FIPS203IPD_KEM512_EK_SIZE], uint8_t dk[static FIPS203IPD_KEM512_DK_SIZE], const uint8_t seed[static FIPS203IPD_KEYGEN_SEED_SIZE])
Generate KEM512 encapsulation key ek and decapsulation key dk from 64 byte random seed seed.
void fips203ipd_kem512_encaps(uint8_t key[static FIPS203IPD_KEY_SIZE], uint8_t ct[static FIPS203IPD_KEM512_CT_SIZE], const uint8_t ek[static FIPS203IPD_KEM512_EK_SIZE], const uint8_t seed[static FIPS203IPD_ENCAPS_SEED_SIZE])
Generate KEM512 shared key key and ciphertext ct from given encapsulation key ek and randomness seed.
void fips203ipd_kem512_decaps(uint8_t key[static FIPS203IPD_KEY_SIZE], const uint8_t ct[static FIPS203IPD_KEM512_CT_SIZE], const uint8_t dk[static FIPS203IPD_KEM512_DK_SIZE])
Decapsulate shared key key from ciphertext ct using KEM512 decapsulation key dk with implicit rejecti...
void fips203ipd_kem768_encaps(uint8_t key[static FIPS203IPD_KEY_SIZE], uint8_t ct[static FIPS203IPD_KEM768_CT_SIZE], const uint8_t ek[static FIPS203IPD_KEM768_EK_SIZE], const uint8_t seed[static FIPS203IPD_ENCAPS_SEED_SIZE])
Generate KEM768 shared key key and ciphertext ct from given encapsulation key ek and randomness seed.
#define FIPS203IPD_KEM768_EK_SIZE
Size of KEM768 encapsulation key, in bytes (384 * K + 32).
Definition: fips203ipd.h:177
void fips203ipd_kem768_keygen(uint8_t ek[static FIPS203IPD_KEM768_EK_SIZE], uint8_t dk[static FIPS203IPD_KEM768_DK_SIZE], const uint8_t seed[static FIPS203IPD_KEYGEN_SEED_SIZE])
Generate KEM768 encapsulation key ek and decapsulation key dk from 64 byte random seed seed.
#define FIPS203IPD_KEM768_CT_SIZE
Size of KEM768 ciphertext, in bytes (32 * (DU * K + DV)).
Definition: fips203ipd.h:189
#define FIPS203IPD_KEM768_DK_SIZE
Size of KEM768 decapsulation key, in bytes (768 * K + 96).
Definition: fips203ipd.h:183
void fips203ipd_kem768_decaps(uint8_t key[static FIPS203IPD_KEY_SIZE], const uint8_t ct[static FIPS203IPD_KEM768_CT_SIZE], const uint8_t dk[static FIPS203IPD_KEM768_DK_SIZE])
Decapsulate shared key key from ciphertext ct using KEM768 decapsulation key dk with implicit rejecti...
#define FIPS203IPD_KEY_SIZE
Size of shared secret key returned by encaps() and decaps(), in bytes.
Definition: fips203ipd.h:62
#define FIPS203IPD_ENCAPS_SEED_SIZE
Size of random seed value for encaps(), in bytes.
Definition: fips203ipd.h:56
#define FIPS203IPD_KEYGEN_SEED_SIZE
Size of random seed value for keygen(), in bytes.
Definition: fips203ipd.h:39