mirror of
https://github.com/saymrwulf/curve25519-dalek-source.git
synced 2026-09-04 20:24:10 +00:00
Merge branch 'fix/166-scalar-random-nostd' into develop
This commit is contained in:
commit
16f00cac16
4 changed files with 12 additions and 2 deletions
|
|
@ -119,7 +119,10 @@ use scalar_mul::window::LookupTable;
|
|||
|
||||
use traits::{Identity, IsIdentity};
|
||||
use traits::ValidityCheck;
|
||||
|
||||
#[cfg(any(feature = "alloc", feature = "std"))]
|
||||
use traits::MultiscalarMul;
|
||||
#[cfg(any(feature = "alloc", feature = "std"))]
|
||||
use traits::VartimeMultiscalarMul;
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -192,7 +192,9 @@ use scalar::Scalar;
|
|||
|
||||
use curve_models::CompletedPoint;
|
||||
|
||||
use traits::{Identity, MultiscalarMul, VartimeMultiscalarMul};
|
||||
use traits::Identity;
|
||||
#[cfg(any(feature = "alloc", feature = "std"))]
|
||||
use traits::{MultiscalarMul, VartimeMultiscalarMul};
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// Compressed points
|
||||
|
|
|
|||
|
|
@ -516,7 +516,6 @@ impl Scalar {
|
|||
/// let mut csprng: OsRng = OsRng::new().unwrap();
|
||||
/// let a: Scalar = Scalar::random(&mut csprng);
|
||||
/// # }
|
||||
#[cfg(feature = "std")]
|
||||
pub fn random<T: Rng + CryptoRng>(rng: &mut T) -> Self {
|
||||
let mut scalar_bytes = [0u8; 64];
|
||||
rng.fill(&mut scalar_bytes);
|
||||
|
|
|
|||
|
|
@ -12,11 +12,16 @@
|
|||
|
||||
#![allow(non_snake_case)]
|
||||
|
||||
#[cfg(any(feature = "alloc", feature = "std"))]
|
||||
use core::borrow::Borrow;
|
||||
|
||||
#[cfg(any(feature = "alloc", feature = "std"))]
|
||||
use edwards::EdwardsPoint;
|
||||
#[cfg(any(feature = "alloc", feature = "std"))]
|
||||
use scalar::Scalar;
|
||||
#[cfg(any(feature = "alloc", feature = "std"))]
|
||||
use traits::MultiscalarMul;
|
||||
#[cfg(any(feature = "alloc", feature = "std"))]
|
||||
use traits::VartimeMultiscalarMul;
|
||||
|
||||
/// Perform multiscalar multiplication by the interleaved window
|
||||
|
|
@ -40,6 +45,7 @@ use traits::VartimeMultiscalarMul;
|
|||
///
|
||||
/// [solution]: https://www.jstor.org/stable/2310929
|
||||
/// [problem]: https://www.jstor.org/stable/2312273
|
||||
#[cfg(any(feature = "alloc", feature = "std"))]
|
||||
pub struct Straus {}
|
||||
|
||||
#[cfg(any(feature = "alloc", feature = "std"))]
|
||||
|
|
|
|||
Loading…
Reference in a new issue