Skip to content

Commit

Permalink
Rename variable in Ed25519
Browse files Browse the repository at this point in the history
  • Loading branch information
ml-james committed Oct 4, 2024
1 parent d2076b6 commit 3c47b7e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/com/lmax/solana4j/util/Ed25519.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ private static BigInteger calculateCandidateRoot(final BigInteger u, final BigIn
final BigInteger uv3 = u.multiply(v3).mod(P);

final BigInteger uv7 = u.multiply(v7).mod(P);
final BigInteger uv7Pow22523 = uv7.modPow(PM5D8, P);
final BigInteger uv7Pm5d8 = uv7.modPow(PM5D8, P);

// after some transformations, given the properties of the e25519 curve we can say
// after some transformations, given the properties of the ed25519 curve we can say
// x^2 = (u/v)
// x1 = (u/v)^(P+3/8) where x1 is the candidate root
// x1 = uv^3(uv^7)^(P-5/8)
return uv3.multiply(uv7Pow22523).mod(P);
return uv3.multiply(uv7Pm5d8).mod(P);
}

private static boolean isCandidateRootValid(final BigInteger x1, final BigInteger v, final BigInteger u)
Expand Down

0 comments on commit 3c47b7e

Please sign in to comment.