Skip to content

Commit 2ec8e72

Browse files
committed
CURVE25519_MAX_KEY_TO_DER_SZ: refactor to macro like other CURVE25519_ constants, and add FIPS clause in curve255519_der_test() to accommodate FIPS v6.
1 parent 9106d12 commit 2ec8e72

2 files changed

Lines changed: 5 additions & 6 deletions

File tree

wolfcrypt/test/test.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35648,7 +35648,11 @@ static wc_test_ret_t curve255519_der_test(void)
3564835648
0xA2, 0x5B, 0x38, 0xFD, 0x96, 0xDB, 0x2A, 0x26
3564935649
};
3565035650
curve25519_key key;
35651+
#if !defined(HAVE_FIPS) || FIPS_VERSION3_GE(7,0,0)
3565135652
byte output[CURVE25519_MAX_KEY_TO_DER_SZ];
35653+
#else
35654+
byte output[128];
35655+
#endif
3565235656
word32 outputSz = (word32)sizeof(output);
3565335657
word32 idx;
3565435658

wolfssl/wolfcrypt/curve25519.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,7 @@
4444

4545
#define CURVE25519_KEYSIZE 32
4646
#define CURVE25519_PUB_KEY_SIZE 32
47-
48-
enum {
49-
CURVE25519_MAX_KEY_TO_DER_SZ = 82, /* for exported DER keys temp buffer */
50-
51-
WOLF_ENUM_DUMMY_LAST_ELEMENT(CURVE25519)
52-
};
47+
#define CURVE25519_MAX_KEY_TO_DER_SZ 82 /* for exported DER keys temp buffer */
5348

5449
#ifdef WOLFSSL_NAMES_STATIC
5550
typedef char curve25519_str[12];

0 commit comments

Comments
 (0)