fips203ipd
C11 implementation of FIPS 203 initial public draft (IPD).
Macros | Functions
fips203ipd.h File Reference

C11 implementation of ML-KEM from the FIPS 203 initial public draft. More...

#include <stdint.h>
Include dependency graph for fips203ipd.h:

Go to the source code of this file.

Macros

#define FIPS203IPD_KEYGEN_SEED_SIZE   64
 Size of random seed value for keygen(), in bytes. More...
 
#define FIPS203IPD_ENCAPS_SEED_SIZE   32
 Size of random seed value for encaps(), in bytes. More...
 
#define FIPS203IPD_KEY_SIZE   32
 Size of shared secret key returned by encaps() and decaps(), in bytes.
 
#define FIPS203IPD_KEM512_EK_SIZE   800
 Size of KEM512 encapsulation key, in bytes (384 * K + 32).
 
#define FIPS203IPD_KEM512_DK_SIZE   1632
 Size of KEM512 decapsulation key, in bytes (768 * K + 96).
 
#define FIPS203IPD_KEM512_CT_SIZE   768
 Size of KEM512 ciphertext, in bytes (32 * (DU * K + DV)).
 
#define FIPS203IPD_KEM768_EK_SIZE   1184
 Size of KEM768 encapsulation key, in bytes (384 * K + 32).
 
#define FIPS203IPD_KEM768_DK_SIZE   2400
 Size of KEM768 decapsulation key, in bytes (768 * K + 96).
 
#define FIPS203IPD_KEM768_CT_SIZE   1088
 Size of KEM768 ciphertext, in bytes (32 * (DU * K + DV)).
 
#define FIPS203IPD_KEM1024_EK_SIZE   1568
 Size of KEM1024 encapsulation key, in bytes (384 * K + 32).
 
#define FIPS203IPD_KEM1024_DK_SIZE   3168
 Size of KEM1024 decapsulation key, in bytes (768 * K + 96).
 
#define FIPS203IPD_KEM1024_CT_SIZE   1568
 Size of KEM1024 ciphertext, in bytes (32 * (DU * K + DV)).
 

Functions

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. More...
 
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. More...
 
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 rejection. More...
 
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. More...
 
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. More...
 
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 rejection. More...
 
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. More...
 
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. More...
 
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 rejection. More...
 
const char * fips203ipd_backend (void)
 Get name of backend. More...
 

Detailed Description

C11 implementation of ML-KEM from the FIPS 203 initial public draft.

Author
Paul Duncan

fips203ipd https://pablotron.org/fips203ipd

Copyright (c) 2023-2024 Paul Duncan SPDX-License-Identifier: MIT-0

C11 implementation of ML-KEM from the FIPS 203 initial public draft.