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
29#define FIPS203IPD_KEM512_EK_SIZE 800
30
35#define FIPS203IPD_KEM512_DK_SIZE 1632
36
41#define FIPS203IPD_KEM512_CT_SIZE 768
42
66void fips203ipd_kem512_keygen(uint8_t ek[static FIPS203IPD_KEM512_EK_SIZE], uint8_t dk[static FIPS203IPD_KEM512_DK_SIZE], const uint8_t seed[static 64]);
67
97void fips203ipd_kem512_encaps(uint8_t key[static 32], uint8_t ct[static FIPS203IPD_KEM512_CT_SIZE], const uint8_t ek[static FIPS203IPD_KEM512_EK_SIZE], const uint8_t seed[static 32]);
98
122void fips203ipd_kem512_decaps(uint8_t key[static 32], const uint8_t ct[static FIPS203IPD_KEM512_CT_SIZE], const uint8_t dk[static FIPS203IPD_KEM512_DK_SIZE]);
123
133#define FIPS203IPD_KEM768_EK_SIZE 1184
134
139#define FIPS203IPD_KEM768_DK_SIZE 2400
140
145#define FIPS203IPD_KEM768_CT_SIZE 1088
146
170void fips203ipd_kem768_keygen(uint8_t ek[static FIPS203IPD_KEM768_EK_SIZE], uint8_t dk[static FIPS203IPD_KEM768_DK_SIZE], const uint8_t seed[static 64]);
171
201void fips203ipd_kem768_encaps(uint8_t key[static 32], uint8_t ct[static FIPS203IPD_KEM768_CT_SIZE], const uint8_t ek[static FIPS203IPD_KEM768_EK_SIZE], const uint8_t seed[static 32]);
202
226void fips203ipd_kem768_decaps(uint8_t key[static 32], const uint8_t ct[static FIPS203IPD_KEM768_CT_SIZE], const uint8_t dk[static FIPS203IPD_KEM768_DK_SIZE]);
227
237#define FIPS203IPD_KEM1024_EK_SIZE 1568
238
243#define FIPS203IPD_KEM1024_DK_SIZE 3168
244
249#define FIPS203IPD_KEM1024_CT_SIZE 1568
250
274void fips203ipd_kem1024_keygen(uint8_t ek[static FIPS203IPD_KEM1024_EK_SIZE], uint8_t dk[static FIPS203IPD_KEM1024_DK_SIZE], const uint8_t seed[static 64]);
275
305void fips203ipd_kem1024_encaps(uint8_t key[static 32], uint8_t ct[static FIPS203IPD_KEM1024_CT_SIZE], const uint8_t ek[static FIPS203IPD_KEM1024_EK_SIZE], const uint8_t seed[static 32]);
306
330void fips203ipd_kem1024_decaps(uint8_t key[static 32], const uint8_t ct[static FIPS203IPD_KEM1024_CT_SIZE], const uint8_t dk[static FIPS203IPD_KEM1024_DK_SIZE]);
331
332#endif /* FIPS203IPD_H */
#define FIPS203IPD_KEM1024_CT_SIZE
Size of KEM1024 ciphertext, in bytes (32 * (DU * K + DV)).
Definition: fips203ipd.h:249
void fips203ipd_kem1024_encaps(uint8_t key[static 32], uint8_t ct[static FIPS203IPD_KEM1024_CT_SIZE], const uint8_t ek[static FIPS203IPD_KEM1024_EK_SIZE], const uint8_t seed[static 32])
Generate KEM1024 shared key key and ciphertext ct from given encapsulation key ek and randomness seed...
#define FIPS203IPD_KEM1024_EK_SIZE
Size of KEM1024 encapsulation key, in bytes (384 * K + 32).
Definition: fips203ipd.h:237
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 64])
Generate KEM1024 encapsulation key ek and decapsulation key dk from 64 byte random seed seed.
#define FIPS203IPD_KEM1024_DK_SIZE
Size of KEM1024 decapsulation key, in bytes (768 * K + 96).
Definition: fips203ipd.h:243
void fips203ipd_kem1024_decaps(uint8_t key[static 32], 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:35
#define FIPS203IPD_KEM512_CT_SIZE
Size of KEM512 ciphertext, in bytes (32 * (DU * K + DV)).
Definition: fips203ipd.h:41
#define FIPS203IPD_KEM512_EK_SIZE
Size of KEM512 encapsulation key, in bytes (384 * K + 32).
Definition: fips203ipd.h:29
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 64])
Generate KEM512 encapsulation key ek and decapsulation key dk from 64 byte random seed seed.
void fips203ipd_kem512_decaps(uint8_t key[static 32], 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_kem512_encaps(uint8_t key[static 32], uint8_t ct[static FIPS203IPD_KEM512_CT_SIZE], const uint8_t ek[static FIPS203IPD_KEM512_EK_SIZE], const uint8_t seed[static 32])
Generate KEM512 shared key key and ciphertext ct from given encapsulation key ek and randomness seed.
void fips203ipd_kem768_decaps(uint8_t key[static 32], 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_KEM768_EK_SIZE
Size of KEM768 encapsulation key, in bytes (384 * K + 32).
Definition: fips203ipd.h:133
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 64])
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:145
void fips203ipd_kem768_encaps(uint8_t key[static 32], uint8_t ct[static FIPS203IPD_KEM768_CT_SIZE], const uint8_t ek[static FIPS203IPD_KEM768_EK_SIZE], const uint8_t seed[static 32])
Generate KEM768 shared key key and ciphertext ct from given encapsulation key ek and randomness seed.
#define FIPS203IPD_KEM768_DK_SIZE
Size of KEM768 decapsulation key, in bytes (768 * K + 96).
Definition: fips203ipd.h:139