The NIST round 3 Falcon Signature Scheme integration.

This commit is contained in:
Anthony Hu
2021-10-14 10:43:08 -04:00
parent 2745f394e5
commit 81def76b18
14 changed files with 2105 additions and 156 deletions

View File

@@ -75,6 +75,10 @@ This library defines the interface APIs for X509 certificates.
typedef struct DhKey DhKey;
#define WC_DH_TYPE_DEFINED
#endif
#ifndef WC_FALCONKEY_TYPE_DEFINED
typedef struct falcon_key falcon_key;
#define WC_FALCONKEY_TYPE_DEFINED
#endif
enum Ecc_Sum {
ECC_SECP112R1_OID = 182,
@@ -138,6 +142,8 @@ enum CertType {
DETECT_CERT_TYPE,
DH_PRIVATEKEY_TYPE,
X942_PARAM_TYPE,
FALCON_LEVEL1_TYPE,
FALCON_LEVEL5_TYPE,
};
@@ -169,7 +175,10 @@ enum Ctc_SigType {
CTC_SHA3_512wRSA = 430,
CTC_ED25519 = 256,
CTC_ED448 = 257
CTC_ED448 = 257,
CTC_FALCON_LEVEL1 = 268,
CTC_FALCON_LEVEL5 = 271
};
enum Ctc_Encoding {
@@ -609,7 +618,8 @@ WOLFSSL_API int wc_DhPrivKeyToDer(DhKey* key, byte* out, word32* outSz);
((defined(HAVE_ED25519) && defined(HAVE_ED25519_KEY_EXPORT)) || \
(defined(HAVE_CURVE25519) && defined(HAVE_CURVE25519_KEY_EXPORT)) || \
(defined(HAVE_ED448) && defined(HAVE_ED448_KEY_EXPORT)) || \
(defined(HAVE_CURVE448) && defined(HAVE_CURVE448_KEY_EXPORT)))
(defined(HAVE_CURVE448) && defined(HAVE_CURVE448_KEY_EXPORT)) || \
(defined(HAVE_LIBOQS)))
#define WC_ENABLE_ASYM_KEY_EXPORT
#endif
@@ -617,7 +627,8 @@ WOLFSSL_API int wc_DhPrivKeyToDer(DhKey* key, byte* out, word32* outSz);
((defined(HAVE_ED25519) && defined(HAVE_ED25519_KEY_IMPORT)) || \
(defined(HAVE_CURVE25519) && defined(HAVE_CURVE25519_KEY_IMPORT)) || \
(defined(HAVE_ED448) && defined(HAVE_ED448_KEY_IMPORT)) || \
(defined(HAVE_CURVE448) && defined(HAVE_CURVE448_KEY_IMPORT)))
(defined(HAVE_CURVE448) && defined(HAVE_CURVE448_KEY_IMPORT)) || \
(defined(HAVE_LIBOQS)))
#define WC_ENABLE_ASYM_KEY_IMPORT
#endif
@@ -656,6 +667,14 @@ WOLFSSL_API int wc_Ed448PublicKeyToDer(ed448_key*, byte*, word32, int);
#endif
#endif /* HAVE_ED448 */
#ifdef HAVE_LIBOQS
WOLFSSL_API int wc_Falcon_PrivateKeyDecode(const byte*, word32*, falcon_key*, word32);
WOLFSSL_API int wc_Falcon_PublicKeyDecode(const byte*, word32*, falcon_key*, word32);
WOLFSSL_API int wc_Falcon_KeyToDer(falcon_key*, byte*, word32);
WOLFSSL_API int wc_Falcon_PrivateKeyToDer(falcon_key*, byte*, word32);
WOLFSSL_API int wc_Falcon_PublicKeyToDer(falcon_key*, byte*, word32, int);
#endif /* HAVE_LIBOQS */
#ifdef HAVE_CURVE448
#ifdef HAVE_CURVE448_KEY_IMPORT
WOLFSSL_API int wc_Curve448PrivateKeyDecode(const byte*, word32*, curve448_key*, word32);