mirror of
https://github.com/saymrwulf/curve25519-dalek-source.git
synced 2026-09-08 21:00:40 +00:00
Fix up constants docstrings
This commit is contained in:
parent
d3a8ee0d7b
commit
739755cb1c
1 changed files with 15 additions and 8 deletions
|
|
@ -38,10 +38,12 @@ pub use backend::u64::constants::*;
|
||||||
#[cfg(not(feature="radix_51"))]
|
#[cfg(not(feature="radix_51"))]
|
||||||
pub use backend::u32::constants::*;
|
pub use backend::u32::constants::*;
|
||||||
|
|
||||||
/// Basepoint has y = 4/5.
|
/// The Ed25519 basepoint, in `CompressedEdwardsY` format.
|
||||||
///
|
///
|
||||||
/// Generated with Sage: these are the bytes of 4/5 in 𝔽_p. The
|
/// This is the little-endian byte encoding of \\( 4/5 \pmod p \\),
|
||||||
/// sign bit is 0 since the basepoint has x chosen to be positive.
|
/// which is the \\(y\\)-coordinate of the Ed25519 basepoint.
|
||||||
|
///
|
||||||
|
/// The sign bit is 0 since the basepoint has \\(x\\) chosen to be positive.
|
||||||
pub const BASE_CMPRSSD: CompressedEdwardsY =
|
pub const BASE_CMPRSSD: CompressedEdwardsY =
|
||||||
CompressedEdwardsY([0x58, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66,
|
CompressedEdwardsY([0x58, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66,
|
||||||
0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66,
|
0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66,
|
||||||
|
|
@ -56,12 +58,16 @@ pub const BASE_COMPRESSED_MONTGOMERY: CompressedMontgomeryU =
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]);
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]);
|
||||||
|
|
||||||
|
|
||||||
/// The Ed25519 basepoint, as a `RistrettoPoint`. This is called `_POINT` to distinguish it from
|
/// The Ristretto basepoint, as a `RistrettoPoint`.
|
||||||
/// `_TABLE`, which provides fast scalar multiplication.
|
///
|
||||||
|
/// This is called `_POINT` to distinguish it from `_TABLE`, which
|
||||||
|
/// provides fast scalar multiplication.
|
||||||
pub const RISTRETTO_BASEPOINT_POINT: RistrettoPoint = RistrettoPoint(ED25519_BASEPOINT_POINT);
|
pub const RISTRETTO_BASEPOINT_POINT: RistrettoPoint = RistrettoPoint(ED25519_BASEPOINT_POINT);
|
||||||
|
|
||||||
/// `BASEPOINT_ORDER` is the order of base point, i.e. `l = 2^252 +
|
/// `BASEPOINT_ORDER` is the order of the Ristretto group and of the Ed25519 basepoint, i.e.,
|
||||||
/// 27742317777372353535851937790883648493`, in little-endian bytes.
|
/// $$
|
||||||
|
/// \ell = 2^\{252\} + 27742317777372353535851937790883648493.
|
||||||
|
/// $$
|
||||||
pub const BASEPOINT_ORDER: Scalar = Scalar{
|
pub const BASEPOINT_ORDER: Scalar = Scalar{
|
||||||
bytes: [
|
bytes: [
|
||||||
0xed, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58,
|
0xed, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58,
|
||||||
|
|
@ -78,7 +84,8 @@ include!(concat!(env!("OUT_DIR"), "/basepoint_table.rs"));
|
||||||
|
|
||||||
#[cfg(feature="precomputed_tables")]
|
#[cfg(feature="precomputed_tables")]
|
||||||
use ristretto::RistrettoBasepointTable;
|
use ristretto::RistrettoBasepointTable;
|
||||||
/// The Ed25519 basepoint, as a RistrettoPoint
|
|
||||||
|
/// The Ristretto basepoint, as a `RistrettoBasepointTable` for scalar multiplication.
|
||||||
#[cfg(feature="precomputed_tables")]
|
#[cfg(feature="precomputed_tables")]
|
||||||
pub const RISTRETTO_BASEPOINT_TABLE: RistrettoBasepointTable
|
pub const RISTRETTO_BASEPOINT_TABLE: RistrettoBasepointTable
|
||||||
= RistrettoBasepointTable(ED25519_BASEPOINT_TABLE);
|
= RistrettoBasepointTable(ED25519_BASEPOINT_TABLE);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue