Merge branch 'fix/166-scalar-random-nostd' into develop

This commit is contained in:
Isis Lovecruft 2018-07-20 19:27:37 +00:00
commit 16f00cac16
Failed to extract signature
4 changed files with 12 additions and 2 deletions

View file

@ -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;
// ------------------------------------------------------------------------

View file

@ -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

View file

@ -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);

View file

@ -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"))]