1
1
mirror of https://github.com/henrydcase/pqc.git synced 2024-11-23 16:08:59 +00:00
pqcrypto/crypto_kem/ledakemlt12/clean/qc_ldpc_parameters.h

28 lines
746 B
C
Raw Normal View History

2019-05-24 17:38:54 +01:00
#ifndef QC_LDPC_PARAMETERS_H
#define QC_LDPC_PARAMETERS_H
#include "fips202.h"
#define TRNG_BYTE_LENGTH (24)
#define HASH_BYTE_LENGTH (32)
2019-05-24 17:38:54 +01:00
#define HASH_FUNCTION sha3_256
2019-05-24 17:38:54 +01:00
#define N0 (2)
#define P (52147) // modulus(x) = x^P-1
#define DV (9) // odd number
#define M (9)
#define M0 (5)
#define M1 (4)
#define NUM_ERRORS_T (136)
// Derived parameters, they are useful for QC-LDPC algorithms
#define HASH_BIT_LENGTH (HASH_BYTE_LENGTH << 3)
2019-05-24 17:38:54 +01:00
#define K ((N0-1)*P)
#define N (N0*P)
#define DC (N0*DV)
2019-05-24 17:38:54 +01:00
#define Q_BLOCK_WEIGHTS {{M0,M1},{M1,M0}}
static const unsigned char qBlockWeights[N0][N0] = Q_BLOCK_WEIGHTS;
2019-05-24 17:38:54 +01:00
#endif