]> git.codecow.com Git - Monocypher.git/commitdiff
Separated arithmetic moduloL from EdDSA
authorLoup Vaillant <loup@loup-vaillant.fr>
Fri, 27 Mar 2020 16:07:11 +0000 (17:07 +0100)
committerLoup Vaillant <loup@loup-vaillant.fr>
Fri, 27 Mar 2020 16:07:11 +0000 (17:07 +0100)
src/monocypher.c

index 59496f679b29c5ab00da5b04e42c5f8738980964..01bc4b79d19ae8089378400d3b63a191ca8b7f00 100644 (file)
@@ -1487,10 +1487,9 @@ void crypto_x25519_public_key(u8       public_key[32],
     crypto_x25519(public_key, secret_key, base_point);
 }
 
-///////////////
-/// Ed25519 ///
-///////////////
-
+///////////////////////////
+/// Arithmetic modulo L ///
+///////////////////////////
 static const  u8 L[32] = {
     0xed, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58,
     0xd6, 0x9c, 0xf7, 0xa2, 0xde, 0xf9, 0xde, 0x14,
@@ -1562,6 +1561,10 @@ static int is_above_L(const u8 a[32])
     return 1;
 }
 
+///////////////
+/// Ed25519 ///
+///////////////
+
 // Point (group element, ge) in a twisted Edwards curve,
 // in extended projective coordinates.
 // ge        : x  = X/Z, y  = Y/Z, T  = XY/Z