Skip to content

Commit 57655e0

Browse files
committed
Address Marco's concern about WOLFSSL_CURVE25519_USE_ED25519 pulling in field math
1 parent 2bc5d47 commit 57655e0

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

wolfssl/wolfcrypt/fe_operations.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,15 @@
6363
#define CURVED25519_ASM
6464
#endif
6565

66-
/* curve25519 shares the ed25519 field math, and borrows the group math
67-
* on some builds.
68-
* For WOLF_CRYPTO_CB_ONLY_ED25519 to strip the fe/ge modules, ensure that
69-
* curve25519 is disabled. */
66+
/* curve25519 always uses its own field math, but on some builds it borrows
67+
* ed25519's group math via WOLFSSL_CURVE25519_USE_ED25519 below. Under
68+
* WOLF_CRYPTO_CB_ONLY_ED25519 ed25519's group math is removed. */
7069
#if (defined(CURVED25519_ASM_64BIT) || defined(HAVE_ED25519)) && \
7170
!defined(WOLFSSL_CURVE25519_BLINDING) && \
7271
!defined(WOLFSSL_CURVE25519_NOT_USE_ED25519) && \
73-
(!defined(WOLF_CRYPTO_CB_ONLY_ED25519) || defined(HAVE_CURVE25519))
72+
(!defined(WOLF_CRYPTO_CB_ONLY_ED25519) || \
73+
(defined(HAVE_CURVE25519) && \
74+
!defined(WOLF_CRYPTO_CB_ONLY_CURVE25519)))
7475
#undef WOLFSSL_CURVE25519_USE_ED25519
7576
#define WOLFSSL_CURVE25519_USE_ED25519
7677
#endif

0 commit comments

Comments
 (0)