Skip to content

Commit

Permalink
removed Falcon accordingly to the draft-ounsworth-pq-composite-sigs-13
Browse files Browse the repository at this point in the history
  • Loading branch information
feventura committed Mar 4, 2024
1 parent 361c5f0 commit a8c2f92
Show file tree
Hide file tree
Showing 12 changed files with 59 additions and 279 deletions.
3 changes: 0 additions & 3 deletions ALGORITHMS.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,6 @@ adapting the OIDs of all supported signature algorithms as per the table below.
| falcon512 | 1.3.9999.3.6 |Yes| OQS_OID_FALCON512
| p256_falcon512 | 1.3.9999.3.7 |Yes| OQS_OID_P256_FALCON512
| rsa3072_falcon512 | 1.3.9999.3.8 |Yes| OQS_OID_RSA3072_FALCON512
| falcon512_p256 | 2.16.840.1.114027.80.8.1.14 |Yes| OQS_OID_FALCON512_p256
| falcon512_bp256 | 2.16.840.1.114027.80.8.1.15 |Yes| OQS_OID_FALCON512_bp256
| falcon512_ed25519 | 2.16.840.1.114027.80.8.1.16 |Yes| OQS_OID_FALCON512_ed25519
| falcon1024 | 1.3.9999.3.9 |Yes| OQS_OID_FALCON1024
| p521_falcon1024 | 1.3.9999.3.10 |Yes| OQS_OID_P521_FALCON1024
| sphincssha2128fsimple | 1.3.9999.6.4.13 |Yes| OQS_OID_SPHINCSSHA2128FSIMPLE
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ This implementation makes available the following quantum safe algorithms:

- **CRYSTALS-Dilithium**:`dilithium2`\*, `p256_dilithium2`\*, `rsa3072_dilithium2`\*, `dilithium3`\*, `p384_dilithium3`\*, `dilithium5`\*, `p521_dilithium5`\*
- **ML-DSA**:`mldsa44`\*, `p256_mldsa44`\*, `rsa3072_mldsa44`\*, `mldsa44_pss2048`\*, `mldsa44_rsa2048`\*, `mldsa44_ed25519`\*, `mldsa44_p256`\*, `mldsa44_bp256`\*, `mldsa65`\*, `p384_mldsa65`\*, `mldsa65_pss3072`\*, `mldsa65_rsa3072`\*, `mldsa65_p256`\*, `mldsa65_bp256`\*, `mldsa65_ed25519`\*, `mldsa87`\*, `p521_mldsa87`\*, `mldsa87_p384`\*, `mldsa87_bp384`\*, `mldsa87_ed448`\*
- **Falcon**:`falcon512`\*, `p256_falcon512`\*, `rsa3072_falcon512`\*, `falcon512_p256`\*, `falcon512_bp256`\*, `falcon512_ed25519`\*, `falcon1024`\*, `p521_falcon1024`\*
- **Falcon**:`falcon512`\*, `p256_falcon512`\*, `rsa3072_falcon512`\*, `falcon1024`\*, `p521_falcon1024`\*

- **SPHINCS-SHA2**:`sphincssha2128fsimple`\*, `p256_sphincssha2128fsimple`\*, `rsa3072_sphincssha2128fsimple`\*, `sphincssha2128ssimple`\*, `p256_sphincssha2128ssimple`\*, `rsa3072_sphincssha2128ssimple`\*, `sphincssha2192fsimple`\*, `p384_sphincssha2192fsimple`\*, `sphincssha2192ssimple`, `p384_sphincssha2192ssimple`, `sphincssha2256fsimple`, `p521_sphincssha2256fsimple`, `sphincssha2256ssimple`, `p521_sphincssha2256ssimple`
- **SPHINCS-SHAKE**:`sphincsshake128fsimple`\*, `p256_sphincsshake128fsimple`\*, `rsa3072_sphincsshake128fsimple`\*, `sphincsshake128ssimple`, `p256_sphincsshake128ssimple`, `rsa3072_sphincsshake128ssimple`, `sphincsshake192fsimple`, `p384_sphincsshake192fsimple`, `sphincsshake192ssimple`, `p384_sphincsshake192ssimple`, `sphincsshake256fsimple`, `p521_sphincsshake256fsimple`, `sphincsshake256ssimple`, `p521_sphincsshake256ssimple`
Expand Down
14 changes: 1 addition & 13 deletions oqs-template/generate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ sigs:
# 'oid': '2.16.840.1.114027.80.1.8'}]
-
# The Composite OIDs are kept up to date by @feventura (Entrust)
# These are prototype OIDs and are in line with draft-ounsworth-pq-composite-sigs-12
# These are prototype OIDs and are in line with draft-ounsworth-pq-composite-sigs-13
# OID scheme for composite variants:
# joint-iso-itu-t (2)
# country (16)
Expand Down Expand Up @@ -666,18 +666,6 @@ sigs:
'pretty_name': 'RSA3072',
'oid': '1.3.9999.3.8',
'code_point': '0xfeb0'}]
composite: [{'name': 'p256',
'pretty_name': 'ECDSA p256',
'security': '128',
'oid': '2.16.840.1.114027.80.8.1.14'},
{'name': 'bp256',
'pretty_name': 'ECDSA brainpoolP256r1',
'security': '256',
'oid': '2.16.840.1.114027.80.8.1.15'},
{'name': 'ed25519',
'pretty_name': 'ED25519',
'security': '128',
'oid': '2.16.840.1.114027.80.8.1.16'}]
extra_nids:
old:
- implementation_version: NIST Round 3 submission
Expand Down
7 changes: 0 additions & 7 deletions oqsprov/oqs_decode_der2key.c
Original file line number Diff line number Diff line change
Expand Up @@ -751,13 +751,6 @@ MAKE_DECODER(, "p256_falcon512", p256_falcon512, oqsx, SubjectPublicKeyInfo);
MAKE_DECODER(, "rsa3072_falcon512", rsa3072_falcon512, oqsx, PrivateKeyInfo);
MAKE_DECODER(, "rsa3072_falcon512", rsa3072_falcon512, oqsx,
SubjectPublicKeyInfo);
MAKE_DECODER(, "falcon512_p256", falcon512_p256, oqsx, PrivateKeyInfo);
MAKE_DECODER(, "falcon512_p256", falcon512_p256, oqsx, SubjectPublicKeyInfo);
MAKE_DECODER(, "falcon512_bp256", falcon512_bp256, oqsx, PrivateKeyInfo);
MAKE_DECODER(, "falcon512_bp256", falcon512_bp256, oqsx, SubjectPublicKeyInfo);
MAKE_DECODER(, "falcon512_ed25519", falcon512_ed25519, oqsx, PrivateKeyInfo);
MAKE_DECODER(, "falcon512_ed25519", falcon512_ed25519, oqsx,
SubjectPublicKeyInfo);
MAKE_DECODER(, "falcon1024", falcon1024, oqsx, PrivateKeyInfo);
MAKE_DECODER(, "falcon1024", falcon1024, oqsx, SubjectPublicKeyInfo);
MAKE_DECODER(, "p521_falcon1024", p521_falcon1024, oqsx, PrivateKeyInfo);
Expand Down
30 changes: 0 additions & 30 deletions oqsprov/oqs_encode_key2any.c
Original file line number Diff line number Diff line change
Expand Up @@ -1180,15 +1180,6 @@ static int oqsx_pki_priv_to_der(const void *vxkey, unsigned char **pder)
#define rsa3072_falcon512_evp_type 0
#define rsa3072_falcon512_input_type "rsa3072_falcon512"
#define rsa3072_falcon512_pem_type "rsa3072_falcon512"
#define falcon512_p256_evp_type 0
#define falcon512_p256_input_type "falcon512_p256"
#define falcon512_p256_pem_type "falcon512_p256"
#define falcon512_bp256_evp_type 0
#define falcon512_bp256_input_type "falcon512_bp256"
#define falcon512_bp256_pem_type "falcon512_bp256"
#define falcon512_ed25519_evp_type 0
#define falcon512_ed25519_input_type "falcon512_ed25519"
#define falcon512_ed25519_pem_type "falcon512_ed25519"
#define falcon1024_evp_type 0
#define falcon1024_input_type "falcon1024"
#define falcon1024_pem_type "falcon1024"
Expand Down Expand Up @@ -2478,27 +2469,6 @@ MAKE_ENCODER(, rsa3072_falcon512, oqsx, PrivateKeyInfo, pem);
MAKE_ENCODER(, rsa3072_falcon512, oqsx, SubjectPublicKeyInfo, der);
MAKE_ENCODER(, rsa3072_falcon512, oqsx, SubjectPublicKeyInfo, pem);
MAKE_TEXT_ENCODER(, rsa3072_falcon512);
MAKE_ENCODER(, falcon512_p256, oqsx, EncryptedPrivateKeyInfo, der);
MAKE_ENCODER(, falcon512_p256, oqsx, EncryptedPrivateKeyInfo, pem);
MAKE_ENCODER(, falcon512_p256, oqsx, PrivateKeyInfo, der);
MAKE_ENCODER(, falcon512_p256, oqsx, PrivateKeyInfo, pem);
MAKE_ENCODER(, falcon512_p256, oqsx, SubjectPublicKeyInfo, der);
MAKE_ENCODER(, falcon512_p256, oqsx, SubjectPublicKeyInfo, pem);
MAKE_TEXT_ENCODER(, falcon512_p256);
MAKE_ENCODER(, falcon512_bp256, oqsx, EncryptedPrivateKeyInfo, der);
MAKE_ENCODER(, falcon512_bp256, oqsx, EncryptedPrivateKeyInfo, pem);
MAKE_ENCODER(, falcon512_bp256, oqsx, PrivateKeyInfo, der);
MAKE_ENCODER(, falcon512_bp256, oqsx, PrivateKeyInfo, pem);
MAKE_ENCODER(, falcon512_bp256, oqsx, SubjectPublicKeyInfo, der);
MAKE_ENCODER(, falcon512_bp256, oqsx, SubjectPublicKeyInfo, pem);
MAKE_TEXT_ENCODER(, falcon512_bp256);
MAKE_ENCODER(, falcon512_ed25519, oqsx, EncryptedPrivateKeyInfo, der);
MAKE_ENCODER(, falcon512_ed25519, oqsx, EncryptedPrivateKeyInfo, pem);
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_TEXT_ENCODER(, falcon512_ed25519);
MAKE_ENCODER(, falcon1024, oqsx, EncryptedPrivateKeyInfo, der);
MAKE_ENCODER(, falcon1024, oqsx, EncryptedPrivateKeyInfo, pem);
MAKE_ENCODER(, falcon1024, oqsx, PrivateKeyInfo, der);
Expand Down
88 changes: 26 additions & 62 deletions oqsprov/oqs_kmgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -927,208 +927,175 @@ static void *rsa3072_falcon512_gen_init(void *provctx, int selection)
return oqsx_gen_init(provctx, selection, OQS_SIG_alg_falcon_512,
"rsa3072_falcon512", KEY_TYPE_HYB_SIG, 128, 29);
}
static void *falcon512_p256_new_key(void *provctx)
{
return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_falcon_512,
"falcon512_p256", KEY_TYPE_CMP_SIG, NULL, 128, 30);
}

static void *falcon512_p256_gen_init(void *provctx, int selection)
{
return oqsx_gen_init(provctx, selection, OQS_SIG_alg_falcon_512,
"falcon512_p256", KEY_TYPE_CMP_SIG, 128, 30);
}
static void *falcon512_bp256_new_key(void *provctx)
{
return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_falcon_512,
"falcon512_bp256", KEY_TYPE_CMP_SIG, NULL, 256, 31);
}

static void *falcon512_bp256_gen_init(void *provctx, int selection)
{
return oqsx_gen_init(provctx, selection, OQS_SIG_alg_falcon_512,
"falcon512_bp256", KEY_TYPE_CMP_SIG, 256, 31);
}
static void *falcon512_ed25519_new_key(void *provctx)
{
return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_falcon_512,
"falcon512_ed25519", KEY_TYPE_CMP_SIG, NULL, 128, 32);
}

static void *falcon512_ed25519_gen_init(void *provctx, int selection)
{
return oqsx_gen_init(provctx, selection, OQS_SIG_alg_falcon_512,
"falcon512_ed25519", KEY_TYPE_CMP_SIG, 128, 32);
}
static void *falcon1024_new_key(void *provctx)
{
return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_falcon_1024,
"falcon1024", KEY_TYPE_SIG, NULL, 256, 33);
"falcon1024", KEY_TYPE_SIG, NULL, 256, 30);
}

static void *falcon1024_gen_init(void *provctx, int selection)
{
return oqsx_gen_init(provctx, selection, OQS_SIG_alg_falcon_1024,
"falcon1024", 0, 256, 33);
"falcon1024", 0, 256, 30);
}
static void *p521_falcon1024_new_key(void *provctx)
{
return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_falcon_1024,
"p521_falcon1024", KEY_TYPE_HYB_SIG, NULL, 256, 34);
"p521_falcon1024", KEY_TYPE_HYB_SIG, NULL, 256, 31);
}

static void *p521_falcon1024_gen_init(void *provctx, int selection)
{
return oqsx_gen_init(provctx, selection, OQS_SIG_alg_falcon_1024,
"p521_falcon1024", KEY_TYPE_HYB_SIG, 256, 34);
"p521_falcon1024", KEY_TYPE_HYB_SIG, 256, 31);
}

static void *sphincssha2128fsimple_new_key(void *provctx)
{
return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx),
OQS_SIG_alg_sphincs_sha2_128f_simple,
"sphincssha2128fsimple", KEY_TYPE_SIG, NULL, 128, 35);
"sphincssha2128fsimple", KEY_TYPE_SIG, NULL, 128, 32);
}

static void *sphincssha2128fsimple_gen_init(void *provctx, int selection)
{
return oqsx_gen_init(provctx, selection,
OQS_SIG_alg_sphincs_sha2_128f_simple,
"sphincssha2128fsimple", 0, 128, 35);
"sphincssha2128fsimple", 0, 128, 32);
}
static void *p256_sphincssha2128fsimple_new_key(void *provctx)
{
return oqsx_key_new(
PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_sphincs_sha2_128f_simple,
"p256_sphincssha2128fsimple", KEY_TYPE_HYB_SIG, NULL, 128, 36);
"p256_sphincssha2128fsimple", KEY_TYPE_HYB_SIG, NULL, 128, 33);
}

static void *p256_sphincssha2128fsimple_gen_init(void *provctx, int selection)
{
return oqsx_gen_init(
provctx, selection, OQS_SIG_alg_sphincs_sha2_128f_simple,
"p256_sphincssha2128fsimple", KEY_TYPE_HYB_SIG, 128, 36);
"p256_sphincssha2128fsimple", KEY_TYPE_HYB_SIG, 128, 33);
}
static void *rsa3072_sphincssha2128fsimple_new_key(void *provctx)
{
return oqsx_key_new(
PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_sphincs_sha2_128f_simple,
"rsa3072_sphincssha2128fsimple", KEY_TYPE_HYB_SIG, NULL, 128, 37);
"rsa3072_sphincssha2128fsimple", KEY_TYPE_HYB_SIG, NULL, 128, 34);
}

static void *rsa3072_sphincssha2128fsimple_gen_init(void *provctx,
int selection)
{
return oqsx_gen_init(
provctx, selection, OQS_SIG_alg_sphincs_sha2_128f_simple,
"rsa3072_sphincssha2128fsimple", KEY_TYPE_HYB_SIG, 128, 37);
"rsa3072_sphincssha2128fsimple", KEY_TYPE_HYB_SIG, 128, 34);
}
static void *sphincssha2128ssimple_new_key(void *provctx)
{
return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx),
OQS_SIG_alg_sphincs_sha2_128s_simple,
"sphincssha2128ssimple", KEY_TYPE_SIG, NULL, 128, 38);
"sphincssha2128ssimple", KEY_TYPE_SIG, NULL, 128, 35);
}

static void *sphincssha2128ssimple_gen_init(void *provctx, int selection)
{
return oqsx_gen_init(provctx, selection,
OQS_SIG_alg_sphincs_sha2_128s_simple,
"sphincssha2128ssimple", 0, 128, 38);
"sphincssha2128ssimple", 0, 128, 35);
}
static void *p256_sphincssha2128ssimple_new_key(void *provctx)
{
return oqsx_key_new(
PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_sphincs_sha2_128s_simple,
"p256_sphincssha2128ssimple", KEY_TYPE_HYB_SIG, NULL, 128, 39);
"p256_sphincssha2128ssimple", KEY_TYPE_HYB_SIG, NULL, 128, 36);
}

static void *p256_sphincssha2128ssimple_gen_init(void *provctx, int selection)
{
return oqsx_gen_init(
provctx, selection, OQS_SIG_alg_sphincs_sha2_128s_simple,
"p256_sphincssha2128ssimple", KEY_TYPE_HYB_SIG, 128, 39);
"p256_sphincssha2128ssimple", KEY_TYPE_HYB_SIG, 128, 36);
}
static void *rsa3072_sphincssha2128ssimple_new_key(void *provctx)
{
return oqsx_key_new(
PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_sphincs_sha2_128s_simple,
"rsa3072_sphincssha2128ssimple", KEY_TYPE_HYB_SIG, NULL, 128, 40);
"rsa3072_sphincssha2128ssimple", KEY_TYPE_HYB_SIG, NULL, 128, 37);
}

static void *rsa3072_sphincssha2128ssimple_gen_init(void *provctx,
int selection)
{
return oqsx_gen_init(
provctx, selection, OQS_SIG_alg_sphincs_sha2_128s_simple,
"rsa3072_sphincssha2128ssimple", KEY_TYPE_HYB_SIG, 128, 40);
"rsa3072_sphincssha2128ssimple", KEY_TYPE_HYB_SIG, 128, 37);
}
static void *sphincssha2192fsimple_new_key(void *provctx)
{
return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx),
OQS_SIG_alg_sphincs_sha2_192f_simple,
"sphincssha2192fsimple", KEY_TYPE_SIG, NULL, 192, 41);
"sphincssha2192fsimple", KEY_TYPE_SIG, NULL, 192, 38);
}

static void *sphincssha2192fsimple_gen_init(void *provctx, int selection)
{
return oqsx_gen_init(provctx, selection,
OQS_SIG_alg_sphincs_sha2_192f_simple,
"sphincssha2192fsimple", 0, 192, 41);
"sphincssha2192fsimple", 0, 192, 38);
}
static void *p384_sphincssha2192fsimple_new_key(void *provctx)
{
return oqsx_key_new(
PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_sphincs_sha2_192f_simple,
"p384_sphincssha2192fsimple", KEY_TYPE_HYB_SIG, NULL, 192, 42);
"p384_sphincssha2192fsimple", KEY_TYPE_HYB_SIG, NULL, 192, 39);
}

static void *p384_sphincssha2192fsimple_gen_init(void *provctx, int selection)
{
return oqsx_gen_init(
provctx, selection, OQS_SIG_alg_sphincs_sha2_192f_simple,
"p384_sphincssha2192fsimple", KEY_TYPE_HYB_SIG, 192, 42);
"p384_sphincssha2192fsimple", KEY_TYPE_HYB_SIG, 192, 39);
}

static void *sphincsshake128fsimple_new_key(void *provctx)
{
return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx),
OQS_SIG_alg_sphincs_shake_128f_simple,
"sphincsshake128fsimple", KEY_TYPE_SIG, NULL, 128, 43);
"sphincsshake128fsimple", KEY_TYPE_SIG, NULL, 128, 40);
}

static void *sphincsshake128fsimple_gen_init(void *provctx, int selection)
{
return oqsx_gen_init(provctx, selection,
OQS_SIG_alg_sphincs_shake_128f_simple,
"sphincsshake128fsimple", 0, 128, 43);
"sphincsshake128fsimple", 0, 128, 40);
}
static void *p256_sphincsshake128fsimple_new_key(void *provctx)
{
return oqsx_key_new(
PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_sphincs_shake_128f_simple,
"p256_sphincsshake128fsimple", KEY_TYPE_HYB_SIG, NULL, 128, 44);
"p256_sphincsshake128fsimple", KEY_TYPE_HYB_SIG, NULL, 128, 41);
}

static void *p256_sphincsshake128fsimple_gen_init(void *provctx, int selection)
{
return oqsx_gen_init(
provctx, selection, OQS_SIG_alg_sphincs_shake_128f_simple,
"p256_sphincsshake128fsimple", KEY_TYPE_HYB_SIG, 128, 44);
"p256_sphincsshake128fsimple", KEY_TYPE_HYB_SIG, 128, 41);
}
static void *rsa3072_sphincsshake128fsimple_new_key(void *provctx)
{
return oqsx_key_new(
PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_sphincs_shake_128f_simple,
"rsa3072_sphincsshake128fsimple", KEY_TYPE_HYB_SIG, NULL, 128, 45);
"rsa3072_sphincsshake128fsimple", KEY_TYPE_HYB_SIG, NULL, 128, 42);
}

static void *rsa3072_sphincsshake128fsimple_gen_init(void *provctx,
int selection)
{
return oqsx_gen_init(
provctx, selection, OQS_SIG_alg_sphincs_shake_128f_simple,
"rsa3072_sphincsshake128fsimple", KEY_TYPE_HYB_SIG, 128, 45);
"rsa3072_sphincsshake128fsimple", KEY_TYPE_HYB_SIG, 128, 42);
}

///// OQS_TEMPLATE_FRAGMENT_KEYMGMT_CONSTRUCTORS_END
Expand Down Expand Up @@ -1310,9 +1277,6 @@ MAKE_SIG_KEYMGMT_FUNCTIONS(mldsa87_ed448)
MAKE_SIG_KEYMGMT_FUNCTIONS(falcon512)
MAKE_SIG_KEYMGMT_FUNCTIONS(p256_falcon512)
MAKE_SIG_KEYMGMT_FUNCTIONS(rsa3072_falcon512)
MAKE_SIG_KEYMGMT_FUNCTIONS(falcon512_p256)
MAKE_SIG_KEYMGMT_FUNCTIONS(falcon512_bp256)
MAKE_SIG_KEYMGMT_FUNCTIONS(falcon512_ed25519)
MAKE_SIG_KEYMGMT_FUNCTIONS(falcon1024)
MAKE_SIG_KEYMGMT_FUNCTIONS(p521_falcon1024)
MAKE_SIG_KEYMGMT_FUNCTIONS(sphincssha2128fsimple)
Expand Down
Loading

0 comments on commit a8c2f92

Please sign in to comment.