Skip to content

Commit

Permalink
fix: typos
Browse files Browse the repository at this point in the history
  • Loading branch information
shuklaayush committed Jan 3, 2024
1 parent 7855480 commit f73bdf5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/ed25519/fq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const MODULUS_STR: &str = "0x7ffffffffffffffffffffffffffffffffffffffffffffffffff
/// `GF(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed).primitive_element()`
const MULTIPLICATIVE_GENERATOR: Fq = Fq::from_raw([0x02, 0x0, 0x0, 0x0]);

/// INV = -(p^{-1} mod 2^64) mod 2^64
/// INV = -(q^{-1} mod 2^64) mod 2^64
const INV: u64 = 0x86bca1af286bca1b;

/// R = 2^256 mod q
Expand All @@ -72,7 +72,7 @@ const TWO_INV: Fq = Fq::from_raw([
0x3fffffffffffffff,
]);

/// sqrt(-1) mod q = 2^((p - 1) / 4) mod q
/// sqrt(-1) mod q = 2^((q - 1) / 4) mod q
const SQRT_MINUS_ONE: Fq = Fq::from_raw([
0xc4ee1b274a0ea0b0,
0x2f431806ad2fe478,
Expand Down
4 changes: 2 additions & 2 deletions src/ed25519/fr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const MODULUS_STR: &str = "0x1000000000000000000000000000000014def9dea2f79cd6581
/// `GF(0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed).primitive_element()`
const MULTIPLICATIVE_GENERATOR: Fr = Fr::from_raw([0x02, 0x0, 0x0, 0x0]);

/// INV = -(q^{-1} mod 2^64) mod 2^64
/// INV = -(r^{-1} mod 2^64) mod 2^64
const INV: u64 = 0xd2b51da312547e1b;

/// R = 2^256 mod r
Expand Down Expand Up @@ -87,7 +87,7 @@ const TWO_INV: Fr = Fr::from_raw([
0x0800000000000000,
]);

/// sqrt(-1) mod p = 2^((p - 1) / 4) mod p
/// sqrt(-1) mod r = 2^((r - 1) / 4) mod r
const SQRT_MINUS_ONE: Fr = Fr::from_raw([
0xbe8775dfebbe07d4,
0x0ef0565342ce83fe,
Expand Down

0 comments on commit f73bdf5

Please sign in to comment.