33232a0343
* Sebastian's HQC merge request * Clean up changes to common infrastructure * Fix Bitmask macro It assumed that ``unsigned long`` was 64 bit * Remove maxlen from nistseedexpander It's a complicated thing to handle because the value is larger than size_t supports on 32-bit platforms * Initialize buffers to help linter * Add Nistseedexpander test * Resolve UB in gf2x.c Some of the shifts could be larger than WORD_SIZE_BITS, ie. larger than the width of uint64_t. This apparently on Intel gets interpreted as the shift mod 64, but on ARM something else happened. * Fix Windows complaints * rename log, exp which appear to be existing functions on MS * Solve endianness problems * remove all spaces before ';' * Fix duplicate consistency * Fix duplicate consistency * Fix complaints by MSVC about narrowing int * Add nistseedexpander.obj to COMMON_OBJECTS_NOPATH * astyle format util.[ch] * add util.h to makefile * Sort includes in util.h * Fix more Windows MSVC complaints Co-authored-by: Sebastian Verschoor <sebastian@zeroknowledge.me> Co-authored-by: Thom Wiggers <thom@thomwiggers.nl>
26 lines
1.0 KiB
C
26 lines
1.0 KiB
C
#ifndef PQCLEAN_HQC1922CCA2_LEAKTIME_API_H
|
|
#define PQCLEAN_HQC1922CCA2_LEAKTIME_API_H
|
|
|
|
/**
|
|
* \file api.h
|
|
* \brief NIST KEM API used by the HQC_KEM IND-CCA2 scheme
|
|
*/
|
|
|
|
#include <stdint.h>
|
|
|
|
#define PQCLEAN_HQC1922CCA2_LEAKTIME_CRYPTO_ALGNAME "HQC_192_2_CCA2"
|
|
|
|
#define PQCLEAN_HQC1922CCA2_LEAKTIME_CRYPTO_SECRETKEYBYTES 5924
|
|
#define PQCLEAN_HQC1922CCA2_LEAKTIME_CRYPTO_PUBLICKEYBYTES 5884
|
|
#define PQCLEAN_HQC1922CCA2_LEAKTIME_CRYPTO_BYTES 64
|
|
#define PQCLEAN_HQC1922CCA2_LEAKTIME_CRYPTO_CIPHERTEXTBYTES 11749
|
|
|
|
// As a technicality, the public key is appended to the secret key in order to respect the NIST API.
|
|
// Without this constraint, CRYPTO_SECRETKEYBYTES would be defined as 32
|
|
|
|
int PQCLEAN_HQC1922CCA2_LEAKTIME_crypto_kem_keypair(uint8_t *pk, uint8_t *sk);
|
|
int PQCLEAN_HQC1922CCA2_LEAKTIME_crypto_kem_enc(uint8_t *ct, uint8_t *ss, const uint8_t *pk);
|
|
int PQCLEAN_HQC1922CCA2_LEAKTIME_crypto_kem_dec(uint8_t *ss, const uint8_t *ct, const uint8_t *sk);
|
|
|
|
#endif
|