mirror of
https://github.com/saymrwulf/risc0-curve25519-dalek-source.git
synced 2026-09-04 20:03:40 +00:00
Change implementation-specific scalar constants to be pub(crate).
This commit is contained in:
parent
c59af2c6b8
commit
cc8528f41f
2 changed files with 14 additions and 14 deletions
|
|
@ -65,22 +65,22 @@ pub const SQRT_MINUS_HALF: FieldElement32 = FieldElement32([ // sqrtMinusHalf
|
|||
|
||||
/// `L` is the order of base point, i.e. 2^252 +
|
||||
/// 27742317777372353535851937790883648493
|
||||
pub const L: Scalar32 = Scalar32([ 0x1cf5d3ed, 0x009318d2, 0x1de73596, 0x1df3bd45,
|
||||
0x0000014d, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00100000 ]);
|
||||
pub(crate) const L: Scalar32 = Scalar32([ 0x1cf5d3ed, 0x009318d2, 0x1de73596, 0x1df3bd45,
|
||||
0x0000014d, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00100000 ]);
|
||||
|
||||
/// `L` * `LFACTOR` = -1 (mod 2^29)
|
||||
pub const LFACTOR: u32 = 0x12547e1b;
|
||||
pub(crate) const LFACTOR: u32 = 0x12547e1b;
|
||||
|
||||
/// `R` = R % L where R = 2^261
|
||||
pub const R: Scalar32 = Scalar32([ 0x114df9ed, 0x1a617303, 0x0f7c098c, 0x16793167,
|
||||
0x1ffd656e, 0x1fffffff, 0x1fffffff, 0x1fffffff,
|
||||
0x000fffff ]);
|
||||
pub(crate) const R: Scalar32 = Scalar32([ 0x114df9ed, 0x1a617303, 0x0f7c098c, 0x16793167,
|
||||
0x1ffd656e, 0x1fffffff, 0x1fffffff, 0x1fffffff,
|
||||
0x000fffff ]);
|
||||
|
||||
/// `RR` = (R^2) % L where R = 2^261
|
||||
pub const RR: Scalar32 = Scalar32([ 0x0b5f9d12, 0x1e141b17, 0x158d7f3d, 0x143f3757,
|
||||
0x1972d781, 0x042feb7c, 0x1ceec73d, 0x1e184d1e,
|
||||
0x0005046d ]);
|
||||
pub(crate) const RR: Scalar32 = Scalar32([ 0x0b5f9d12, 0x1e141b17, 0x158d7f3d, 0x143f3757,
|
||||
0x1972d781, 0x042feb7c, 0x1ceec73d, 0x1e184d1e,
|
||||
0x0005046d ]);
|
||||
|
||||
/// The Ed25519 basepoint has y = 4/5. This is called `_POINT` to
|
||||
/// distinguish it from `_TABLE`, which should be used for scalar
|
||||
|
|
|
|||
|
|
@ -49,16 +49,16 @@ pub(crate) const APLUS2_OVER_FOUR: FieldElement64 = FieldElement64([121666, 0, 0
|
|||
pub(crate) const SQRT_MINUS_APLUS2: FieldElement64 = FieldElement64([1693982333959686, 608509411481997, 2235573344831311, 947681270984193, 266558006233600]);
|
||||
|
||||
/// `L` is the order of base point, i.e. 2^252 + 27742317777372353535851937790883648493
|
||||
pub const L: Scalar64 = Scalar64([ 0x0002631a5cf5d3ed, 0x000dea2f79cd6581, 0x000000000014def9, 0x0000000000000000, 0x0000100000000000 ]);
|
||||
pub(crate) const L: Scalar64 = Scalar64([ 0x0002631a5cf5d3ed, 0x000dea2f79cd6581, 0x000000000014def9, 0x0000000000000000, 0x0000100000000000 ]);
|
||||
|
||||
/// `L` * `LFACTOR` = -1 (mod 2^51)
|
||||
pub const LFACTOR: u64 = 0x51da312547e1b;
|
||||
pub(crate) const LFACTOR: u64 = 0x51da312547e1b;
|
||||
|
||||
/// `R` = R % L where R = 2^260
|
||||
pub const R: Scalar64 = Scalar64([ 0x000f48bd6721e6ed, 0x0003bab5ac67e45a, 0x000fffffeb35e51b, 0x000fffffffffffff, 0x00000fffffffffff ]);
|
||||
pub(crate) const R: Scalar64 = Scalar64([ 0x000f48bd6721e6ed, 0x0003bab5ac67e45a, 0x000fffffeb35e51b, 0x000fffffffffffff, 0x00000fffffffffff ]);
|
||||
|
||||
/// `RR` = (R^2) % L where R = 2^260
|
||||
pub const RR: Scalar64 = Scalar64([ 0x0009d265e952d13b, 0x000d63c715bea69f, 0x0005be65cb687604, 0x0003dceec73d217f, 0x000009411b7c309a ]);
|
||||
pub(crate) const RR: Scalar64 = Scalar64([ 0x0009d265e952d13b, 0x000d63c715bea69f, 0x0005be65cb687604, 0x0003dceec73d217f, 0x000009411b7c309a ]);
|
||||
|
||||
/// The Ed25519 basepoint has y = 4/5. This is called `_POINT` to
|
||||
/// distinguish it from `_TABLE`, which should be used for scalar
|
||||
|
|
|
|||
Loading…
Reference in a new issue