Skip to content

Commit

Permalink
added MLDSA44 algs
Browse files Browse the repository at this point in the history
  • Loading branch information
feventura committed Oct 13, 2023
1 parent 9ba485c commit 208d9d2
Show file tree
Hide file tree
Showing 9 changed files with 389 additions and 56 deletions.
24 changes: 22 additions & 2 deletions oqsprov/oqs_decode_der2key.c
Original file line number Diff line number Diff line change
Expand Up @@ -771,8 +771,28 @@ MAKE_DECODER(, "falcon512_ed25519", falcon512_ed25519,
oqsx, PrivateKeyInfo);
MAKE_DECODER(, "falcon512_ed25519", falcon512_ed25519,
oqsx, SubjectPublicKeyInfo);
MAKE_DECODER(, "dilithium3_pss", dilithium3_pss,
MAKE_DECODER(, "dilithium3_pss3072", dilithium3_pss3072,
oqsx, PrivateKeyInfo);
MAKE_DECODER(, "dilithium3_pss", dilithium3_pss,
MAKE_DECODER(, "dilithium3_pss3072", dilithium3_pss3072,
oqsx, SubjectPublicKeyInfo);
MAKE_DECODER(, "dilithium2_pss2048", dilithium2_pss2048,
oqsx, PrivateKeyInfo);
MAKE_DECODER(, "dilithium2_pss2048", dilithium2_pss2048,
oqsx, SubjectPublicKeyInfo);
MAKE_DECODER(, "dilithium2_rsa2048", dilithium2_rsa2048,
oqsx, PrivateKeyInfo);
MAKE_DECODER(, "dilithium2_rsa2048", dilithium2_rsa2048,
oqsx, SubjectPublicKeyInfo);
MAKE_DECODER(, "dilithium2_ed25519", dilithium2_ed25519,
oqsx, PrivateKeyInfo);
MAKE_DECODER(, "dilithium2_ed25519", dilithium2_ed25519,
oqsx, SubjectPublicKeyInfo);
MAKE_DECODER(, "dilithium2_p256", dilithium2_p256,
oqsx, PrivateKeyInfo);
MAKE_DECODER(, "dilithium2_p256", dilithium2_p256,
oqsx, SubjectPublicKeyInfo);
MAKE_DECODER(, "dilithium2_bp256", dilithium2_bp256,
oqsx, PrivateKeyInfo);
MAKE_DECODER(, "dilithium2_bp256", dilithium2_bp256,
oqsx, SubjectPublicKeyInfo);
///// OQS_TEMPLATE_FRAGMENT_DECODER_MAKE_END
65 changes: 55 additions & 10 deletions oqsprov/oqs_encode_key2any.c
Original file line number Diff line number Diff line change
Expand Up @@ -966,7 +966,22 @@ static int oqsx_pki_priv_to_der(const void *vxkey, unsigned char **pder)
#define rsa3072_sphincsshake128fsimple_input_type \
"rsa3072_sphincsshake128fsimple"
#define rsa3072_sphincsshake128fsimple_pem_type "rsa3072_sphincsshake128fsimple"
# define dilithium3_rsa3072_evp_type 0
# define dilithium2_pss2048_evp_type 0
# define dilithium2_pss2048_input_type "dilithium2_pss2048"
# define dilithium2_pss2048_pem_type "dilithium2_pss2048"
# define dilithium2_rsa2048_evp_type 0
# define dilithium2_rsa2048_input_type "dilithium2_rsa2048"
# define dilithium2_rsa2048_pem_type "dilithium2_rsa2048"
# define dilithium2_ed25519_evp_type 0
# define dilithium2_ed25519_input_type "dilithium2_ed25519"
# define dilithium2_ed25519_pem_type "dilithium2_ed25519"
# define dilithium2_p256_evp_type 0
# define dilithium2_p256_input_type "dilithium2_p256"
# define dilithium2_p256_pem_type "dilithium2_p256"
# define dilithium2_bp256_evp_type 0
# define dilithium2_bp256_input_type "dilithium2_bp256"
# define dilithium2_bp256_pem_type "dilithium2_bp256"
# define dilithium3_rsa2048_evp_type 0
# define dilithium3_rsa3072_input_type "dilithium3_rsa3072"
# define dilithium3_rsa3072_pem_type "dilithium3_rsa3072"
# define dilithium3_p256_evp_type 0
Expand All @@ -984,9 +999,9 @@ static int oqsx_pki_priv_to_der(const void *vxkey, unsigned char **pder)
# define dilithium3_ed25519_evp_type 0
# define dilithium3_ed25519_input_type "dilithium3_ed25519"
# define dilithium3_ed25519_pem_type "dilithium3_ed25519"
# define dilithium3_pss_evp_type 0
# define dilithium3_pss_input_type "dilithium3_pss"
# define dilithium3_pss_pem_type "dilithium3_pss"
# define dilithium3_pss3072_evp_type 0
# define dilithium3_pss3072_input_type "dilithium3_pss3072"
# define dilithium3_pss3072_pem_type "dilithium3_pss3072"
# define dilithium5_bp384_evp_type 0
# define dilithium5_bp384_input_type "dilithium5_bp384"
# define dilithium5_bp384_pem_type "dilithium5_bp384"
Expand Down Expand Up @@ -2111,10 +2126,40 @@ MAKE_ENCODER(, falcon512_ed25519, oqsx, PrivateKeyInfo, der);
MAKE_ENCODER(, falcon512_ed25519, oqsx, PrivateKeyInfo, pem);
MAKE_ENCODER(, falcon512_ed25519, oqsx, SubjectPublicKeyInfo, der);
MAKE_ENCODER(, falcon512_ed25519, oqsx, SubjectPublicKeyInfo, pem);
MAKE_ENCODER(, dilithium3_pss, oqsx, EncryptedPrivateKeyInfo, der);
MAKE_ENCODER(, dilithium3_pss, oqsx, EncryptedPrivateKeyInfo, pem);
MAKE_ENCODER(, dilithium3_pss, oqsx, PrivateKeyInfo, der);
MAKE_ENCODER(, dilithium3_pss, oqsx, PrivateKeyInfo, pem);
MAKE_ENCODER(, dilithium3_pss, oqsx, SubjectPublicKeyInfo, der);
MAKE_ENCODER(, dilithium3_pss, oqsx, SubjectPublicKeyInfo, pem);
MAKE_ENCODER(, dilithium3_pss3072, oqsx, EncryptedPrivateKeyInfo, der);
MAKE_ENCODER(, dilithium3_pss3072, oqsx, EncryptedPrivateKeyInfo, pem);
MAKE_ENCODER(, dilithium3_pss3072, oqsx, PrivateKeyInfo, der);
MAKE_ENCODER(, dilithium3_pss3072, oqsx, PrivateKeyInfo, pem);
MAKE_ENCODER(, dilithium3_pss3072, oqsx, SubjectPublicKeyInfo, der);
MAKE_ENCODER(, dilithium3_pss3072, oqsx, SubjectPublicKeyInfo, pem);
MAKE_ENCODER(, dilithium2_pss2048, oqsx, EncryptedPrivateKeyInfo, der);
MAKE_ENCODER(, dilithium2_pss2048, oqsx, EncryptedPrivateKeyInfo, pem);
MAKE_ENCODER(, dilithium2_pss2048, oqsx, PrivateKeyInfo, der);
MAKE_ENCODER(, dilithium2_pss2048, oqsx, PrivateKeyInfo, pem);
MAKE_ENCODER(, dilithium2_pss2048, oqsx, SubjectPublicKeyInfo, der);
MAKE_ENCODER(, dilithium2_pss2048, oqsx, SubjectPublicKeyInfo, pem);
MAKE_ENCODER(, dilithium2_rsa2048, oqsx, EncryptedPrivateKeyInfo, der);
MAKE_ENCODER(, dilithium2_rsa2048, oqsx, EncryptedPrivateKeyInfo, pem);
MAKE_ENCODER(, dilithium2_rsa2048, oqsx, PrivateKeyInfo, der);
MAKE_ENCODER(, dilithium2_rsa2048, oqsx, PrivateKeyInfo, pem);
MAKE_ENCODER(, dilithium2_rsa2048, oqsx, SubjectPublicKeyInfo, der);
MAKE_ENCODER(, dilithium2_rsa2048, oqsx, SubjectPublicKeyInfo, pem);
MAKE_ENCODER(, dilithium2_ed25519, oqsx, EncryptedPrivateKeyInfo, der);
MAKE_ENCODER(, dilithium2_ed25519, oqsx, EncryptedPrivateKeyInfo, pem);
MAKE_ENCODER(, dilithium2_ed25519, oqsx, PrivateKeyInfo, der);
MAKE_ENCODER(, dilithium2_ed25519, oqsx, PrivateKeyInfo, pem);
MAKE_ENCODER(, dilithium2_ed25519, oqsx, SubjectPublicKeyInfo, der);
MAKE_ENCODER(, dilithium2_ed25519, oqsx, SubjectPublicKeyInfo, pem);
MAKE_ENCODER(, dilithium2_p256, oqsx, EncryptedPrivateKeyInfo, der);
MAKE_ENCODER(, dilithium2_p256, oqsx, EncryptedPrivateKeyInfo, pem);
MAKE_ENCODER(, dilithium2_p256, oqsx, PrivateKeyInfo, der);
MAKE_ENCODER(, dilithium2_p256, oqsx, PrivateKeyInfo, pem);
MAKE_ENCODER(, dilithium2_p256, oqsx, SubjectPublicKeyInfo, der);
MAKE_ENCODER(, dilithium2_p256, oqsx, SubjectPublicKeyInfo, pem);
MAKE_ENCODER(, dilithium2_bp256, oqsx, EncryptedPrivateKeyInfo, der);
MAKE_ENCODER(, dilithium2_bp256, oqsx, EncryptedPrivateKeyInfo, pem);
MAKE_ENCODER(, dilithium2_bp256, oqsx, PrivateKeyInfo, der);
MAKE_ENCODER(, dilithium2_bp256, oqsx, PrivateKeyInfo, pem);
MAKE_ENCODER(, dilithium2_bp256, oqsx, SubjectPublicKeyInfo, der);
MAKE_ENCODER(, dilithium2_bp256, oqsx, SubjectPublicKeyInfo, pem);
///// OQS_TEMPLATE_FRAGMENT_ENCODER_MAKE_END
84 changes: 79 additions & 5 deletions oqsprov/oqs_kmgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1002,20 +1002,89 @@ static void *falcon512_ed25519_gen_init(void *provctx, int selection)
"falcon512_ed25519", KEY_TYPE_CMP_SIG, 128, 32);
}

static void *dilithium3_pss_new_key(void *provctx)
static void *dilithium3_pss3072_new_key(void *provctx)
{
return oqsx_key_new(
PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_dilithium_3,
"dilithium3_pss", KEY_TYPE_CMP_SIG, NULL, 128, 33);
"dilithium3_pss3072", KEY_TYPE_CMP_SIG, NULL, 128, 33);
}

static void *dilithium3_pss_gen_init(void *provctx, int selection)
static void *dilithium3_pss3072_gen_init(void *provctx, int selection)
{
return oqsx_gen_init(
provctx, selection, OQS_SIG_alg_dilithium_3,
"dilithium3_pss", KEY_TYPE_CMP_SIG, 128, 33);
"dilithium3_pss3072", KEY_TYPE_CMP_SIG, 128, 33);
}

static void *dilithium2_pss2048_new_key(void *provctx)
{
return oqsx_key_new(
PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_dilithium_2,
"dilithium2_pss2048", KEY_TYPE_CMP_SIG, NULL, 112, 34);
}

static void *dilithium2_pss2048_gen_init(void *provctx, int selection)
{
return oqsx_gen_init(
provctx, selection, OQS_SIG_alg_dilithium_2,
"dilithium2_pss2048", KEY_TYPE_CMP_SIG, 112, 34);
}

static void *dilithium2_rsa2048_new_key(void *provctx)
{
return oqsx_key_new(
PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_dilithium_2,
"dilithium2_rsa2048", KEY_TYPE_CMP_SIG, NULL, 112, 35);
}

static void *dilithium2_rsa2048_gen_init(void *provctx, int selection)
{
return oqsx_gen_init(
provctx, selection, OQS_SIG_alg_dilithium_2,
"dilithium2_rsa2048", KEY_TYPE_CMP_SIG, 112, 35);
}

static void *dilithium2_ed25519_new_key(void *provctx)
{
return oqsx_key_new(
PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_dilithium_2,
"dilithium2_ed25519", KEY_TYPE_CMP_SIG, NULL, 128, 36);
}

static void *dilithium2_ed25519_gen_init(void *provctx, int selection)
{
return oqsx_gen_init(
provctx, selection, OQS_SIG_alg_dilithium_2,
"dilithium2_ed25519", KEY_TYPE_CMP_SIG, 128, 36);
}

static void *dilithium2_p256_new_key(void *provctx)
{
return oqsx_key_new(
PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_dilithium_2,
"dilithium2_p256", KEY_TYPE_CMP_SIG, NULL, 128, 37);
}

static void *dilithium2_p256_gen_init(void *provctx, int selection)
{
return oqsx_gen_init(
provctx, selection, OQS_SIG_alg_dilithium_2,
"dilithium2_p256", KEY_TYPE_CMP_SIG, 128, 37);
}

static void *dilithium2_bp256_new_key(void *provctx)
{
return oqsx_key_new(
PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_dilithium_2,
"dilithium2_bp256", KEY_TYPE_CMP_SIG, NULL, 256, 38);
}

static void *dilithium2_bp256_gen_init(void *provctx, int selection)
{
return oqsx_gen_init
(provctx, selection, OQS_SIG_alg_dilithium_2,
"dilithium2_bp256", KEY_TYPE_CMP_SIG, 256, 38);
}
///// OQS_TEMPLATE_FRAGMENT_KEYMGMT_CONSTRUCTORS_END

#define MAKE_SIG_KEYMGMT_FUNCTIONS(alg) \
Expand Down Expand Up @@ -1198,7 +1267,12 @@ MAKE_SIG_KEYMGMT_FUNCTIONS(dilithium5_bp384)
MAKE_SIG_KEYMGMT_FUNCTIONS(dilithium5_ed448)
MAKE_SIG_KEYMGMT_FUNCTIONS(falcon512_bp256)
MAKE_SIG_KEYMGMT_FUNCTIONS(falcon512_ed25519)
MAKE_SIG_KEYMGMT_FUNCTIONS(dilithium3_pss)
MAKE_SIG_KEYMGMT_FUNCTIONS(dilithium3_pss3072)
MAKE_SIG_KEYMGMT_FUNCTIONS(dilithium2_pss2048)
MAKE_SIG_KEYMGMT_FUNCTIONS(dilithium2_rsa2048)
MAKE_SIG_KEYMGMT_FUNCTIONS(dilithium2_ed25519)
MAKE_SIG_KEYMGMT_FUNCTIONS(dilithium2_p256)
MAKE_SIG_KEYMGMT_FUNCTIONS(dilithium2_bp256)

MAKE_KEM_KEYMGMT_FUNCTIONS(frodo640aes, OQS_KEM_alg_frodokem_640_aes, 128)

Expand Down
63 changes: 54 additions & 9 deletions oqsprov/oqs_prov.h
Original file line number Diff line number Diff line change
Expand Up @@ -1485,14 +1485,54 @@ extern const OSSL_DISPATCH oqs_falcon512_ed25519_to_SubjectPublicKeyInfo_der_enc
extern const OSSL_DISPATCH oqs_falcon512_ed25519_to_SubjectPublicKeyInfo_pem_encoder_functions[];
extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_falcon512_ed25519_decoder_functions[];
extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_falcon512_ed25519_decoder_functions[];
extern const OSSL_DISPATCH oqs_dilithium3_pss_to_PrivateKeyInfo_der_encoder_functions[];
extern const OSSL_DISPATCH oqs_dilithium3_pss_to_PrivateKeyInfo_pem_encoder_functions[];
extern const OSSL_DISPATCH oqs_dilithium3_pss_to_EncryptedPrivateKeyInfo_der_encoder_functions[];
extern const OSSL_DISPATCH oqs_dilithium3_pss_to_EncryptedPrivateKeyInfo_pem_encoder_functions[];
extern const OSSL_DISPATCH oqs_dilithium3_pss_to_SubjectPublicKeyInfo_der_encoder_functions[];
extern const OSSL_DISPATCH oqs_dilithium3_pss_to_SubjectPublicKeyInfo_pem_encoder_functions[];
extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_dilithium3_pss_decoder_functions[];
extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_dilithium3_pss_decoder_functions[];
extern const OSSL_DISPATCH oqs_dilithium3_pss3072_to_PrivateKeyInfo_der_encoder_functions[];
extern const OSSL_DISPATCH oqs_dilithium3_pss3072_to_PrivateKeyInfo_pem_encoder_functions[];
extern const OSSL_DISPATCH oqs_dilithium3_pss3072_to_EncryptedPrivateKeyInfo_der_encoder_functions[];
extern const OSSL_DISPATCH oqs_dilithium3_pss3072_to_EncryptedPrivateKeyInfo_pem_encoder_functions[];
extern const OSSL_DISPATCH oqs_dilithium3_pss3072_to_SubjectPublicKeyInfo_der_encoder_functions[];
extern const OSSL_DISPATCH oqs_dilithium3_pss3072_to_SubjectPublicKeyInfo_pem_encoder_functions[];
extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_dilithium3_pss3072_decoder_functions[];
extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_dilithium3_pss3072_decoder_functions[];
extern const OSSL_DISPATCH oqs_dilithium2_pss2048_to_PrivateKeyInfo_der_encoder_functions[];
extern const OSSL_DISPATCH oqs_dilithium2_pss2048_to_PrivateKeyInfo_pem_encoder_functions[];
extern const OSSL_DISPATCH oqs_dilithium2_pss2048_to_EncryptedPrivateKeyInfo_der_encoder_functions[];
extern const OSSL_DISPATCH oqs_dilithium2_pss2048_to_EncryptedPrivateKeyInfo_pem_encoder_functions[];
extern const OSSL_DISPATCH oqs_dilithium2_pss2048_to_SubjectPublicKeyInfo_der_encoder_functions[];
extern const OSSL_DISPATCH oqs_dilithium2_pss2048_to_SubjectPublicKeyInfo_pem_encoder_functions[];
extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_dilithium2_pss2048_decoder_functions[];
extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_dilithium2_pss2048_decoder_functions[];
extern const OSSL_DISPATCH oqs_dilithium2_rsa2048_to_PrivateKeyInfo_der_encoder_functions[];
extern const OSSL_DISPATCH oqs_dilithium2_rsa2048_to_PrivateKeyInfo_pem_encoder_functions[];
extern const OSSL_DISPATCH oqs_dilithium2_rsa2048_to_EncryptedPrivateKeyInfo_der_encoder_functions[];
extern const OSSL_DISPATCH oqs_dilithium2_rsa2048_to_EncryptedPrivateKeyInfo_pem_encoder_functions[];
extern const OSSL_DISPATCH oqs_dilithium2_rsa2048_to_SubjectPublicKeyInfo_der_encoder_functions[];
extern const OSSL_DISPATCH oqs_dilithium2_rsa2048_to_SubjectPublicKeyInfo_pem_encoder_functions[];
extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_dilithium2_rsa2048_decoder_functions[];
extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_dilithium2_rsa2048_decoder_functions[];
extern const OSSL_DISPATCH oqs_dilithium2_ed25519_to_PrivateKeyInfo_der_encoder_functions[];
extern const OSSL_DISPATCH oqs_dilithium2_ed25519_to_PrivateKeyInfo_pem_encoder_functions[];
extern const OSSL_DISPATCH oqs_dilithium2_ed25519_to_EncryptedPrivateKeyInfo_der_encoder_functions[];
extern const OSSL_DISPATCH oqs_dilithium2_ed25519_to_EncryptedPrivateKeyInfo_pem_encoder_functions[];
extern const OSSL_DISPATCH oqs_dilithium2_ed25519_to_SubjectPublicKeyInfo_der_encoder_functions[];
extern const OSSL_DISPATCH oqs_dilithium2_ed25519_to_SubjectPublicKeyInfo_pem_encoder_functions[];
extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_dilithium2_ed25519_decoder_functions[];
extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_dilithium2_ed25519_decoder_functions[];
extern const OSSL_DISPATCH oqs_dilithium2_p256_to_PrivateKeyInfo_der_encoder_functions[];
extern const OSSL_DISPATCH oqs_dilithium2_p256_to_PrivateKeyInfo_pem_encoder_functions[];
extern const OSSL_DISPATCH oqs_dilithium2_p256_to_EncryptedPrivateKeyInfo_der_encoder_functions[];
extern const OSSL_DISPATCH oqs_dilithium2_p256_to_EncryptedPrivateKeyInfo_pem_encoder_functions[];
extern const OSSL_DISPATCH oqs_dilithium2_p256_to_SubjectPublicKeyInfo_der_encoder_functions[];
extern const OSSL_DISPATCH oqs_dilithium2_p256_to_SubjectPublicKeyInfo_pem_encoder_functions[];
extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_dilithium2_p256_decoder_functions[];
extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_dilithium2_p256_decoder_functions[];
extern const OSSL_DISPATCH oqs_dilithium2_bp256_to_PrivateKeyInfo_der_encoder_functions[];
extern const OSSL_DISPATCH oqs_dilithium2_bp256_to_PrivateKeyInfo_pem_encoder_functions[];
extern const OSSL_DISPATCH oqs_dilithium2_bp256_to_EncryptedPrivateKeyInfo_der_encoder_functions[];
extern const OSSL_DISPATCH oqs_dilithium2_bp256_to_EncryptedPrivateKeyInfo_pem_encoder_functions[];
extern const OSSL_DISPATCH oqs_dilithium2_bp256_to_SubjectPublicKeyInfo_der_encoder_functions[];
extern const OSSL_DISPATCH oqs_dilithium2_bp256_to_SubjectPublicKeyInfo_pem_encoder_functions[];
extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_dilithium2_bp256_decoder_functions[];
extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_dilithium2_bp256_decoder_functions[];
///// OQS_TEMPLATE_FRAGMENT_ENDECODER_FUNCTIONS_END

///// OQS_TEMPLATE_FRAGMENT_ALG_FUNCTIONS_START
Expand Down Expand Up @@ -1532,7 +1572,12 @@ extern const OSSL_DISPATCH oqs_dilithium5_bp384_keymgmt_functions[];
extern const OSSL_DISPATCH oqs_dilithium5_ed448_keymgmt_functions[];
extern const OSSL_DISPATCH oqs_falcon512_bp256_keymgmt_functions[];
extern const OSSL_DISPATCH oqs_falcon512_ed25519_keymgmt_functions[];
extern const OSSL_DISPATCH oqs_dilithium3_pss_keymgmt_functions[];
extern const OSSL_DISPATCH oqs_dilithium3_pss3072_keymgmt_functions[];
extern const OSSL_DISPATCH oqs_dilithium2_pss2048_keymgmt_functions[];
extern const OSSL_DISPATCH oqs_dilithium2_rsa2048_keymgmt_functions[];
extern const OSSL_DISPATCH oqs_dilithium2_ed25519_keymgmt_functions[];
extern const OSSL_DISPATCH oqs_dilithium2_p256_keymgmt_functions[];
extern const OSSL_DISPATCH oqs_dilithium2_bp256_keymgmt_functions[];

extern const OSSL_DISPATCH oqs_frodo640aes_keymgmt_functions[];

Expand Down
14 changes: 12 additions & 2 deletions oqsprov/oqs_sig.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,12 @@ static const char *composite_OID_hash[] = {
"69642D4D4C44534138372D45643434382D5348414B45323536", //dilithium5_ed448
"69642D46616C636F6E3531322D45434453412D627261696E706F6F6C5032353672312D534841323536", //falcon512_bp256
"69642D46616C636F6E3531322D456432353531392D534841353132", //falcon512_ed25519
"69642D4D4C44534136352D525341333037322D5053532D534841323536", //dilithium3_pss
"69642D4D4C44534136352D525341333037322D5053532D534841323536", //dilithium3_pss3072
"69642D4D4C44534134342D525341323034382D5053532D534841323536", //dilithium2_pss2048
"69642D4D4C44534134342D525341323034382D504B435331352D534841323536", //dilithium2_rsa2048
"69642D4D4C44534134342D456432353531392D534841353132", //dilithium2_ed25519
"69642D4D4C44534134342D45434453412D503235362D534841323536", //dilithium2_p256
"69642D4D4C44534134342D45434453412D627261696E706F6F6C5032353672312D534841323536," //dilithium2_bp256
};

static const size_t composite_OID_hash_len[] = {
Expand All @@ -241,7 +246,12 @@ static const size_t composite_OID_hash_len[] = {
50, //dilithium5_ed448
82, //falcon512_bp256
54, //falcon512_ed25519
58, //dilithium3_pss
58, //dilithium3_pss3072
58, //dilithium2_pss2048
61, //dilithium2_rsa2048
50, //dilithium2_ed25519
56, //dilithium2_p256
79, //dilithium2_bp256
};

/* On entry to this function, data to be signed (tbs) might have been hashed
Expand Down
Loading

0 comments on commit 208d9d2

Please sign in to comment.