Skip to content

Commit

Permalink
chore: fix alloc imports
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbinth committed Mar 18, 2024
1 parent 23932a0 commit 0e17fb7
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/dsa/falcon512/hash_to_point.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use super::{math::FalconFelt, Nonce, Polynomial, Rpo256, Word, MODULUS, N, ZERO};
use alloc::vec::Vec;
use num::Zero;

// HASH-TO-POINT FUNCTIONS
Expand Down
1 change: 1 addition & 0 deletions src/dsa/falcon512/keys/public_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use super::{
ByteReader, ByteWriter, Deserializable, DeserializationError, FalconFelt, Felt, Polynomial,
Serializable, Signature, Word, MODULUS,
};
use alloc::string::ToString;
use core::ops::Deref;
use num::Zero;

Expand Down
2 changes: 1 addition & 1 deletion src/dsa/falcon512/keys/secret_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use super::{
to_complex_fft, PubKeyPoly, PublicKey,
};
use crate::dsa::falcon512::{hash_to_point::hash_to_point_rpo256, SIG_NONCE_LEN, SK_LEN};
use crate::utils::collections::*;
use alloc::{string::ToString, vec::Vec};
use num::{Complex, Zero};
use rand::{thread_rng, Rng};

Check warning on line 16 in src/dsa/falcon512/keys/secret_key.rs

View workflow job for this annotation

GitHub Actions / test nightly on ubuntu with --no-default-features

unused import: `thread_rng`

Check warning on line 16 in src/dsa/falcon512/keys/secret_key.rs

View workflow job for this annotation

GitHub Actions / test stable on ubuntu with --no-default-features

unused import: `thread_rng`

Expand Down
1 change: 1 addition & 0 deletions src/dsa/falcon512/math/codec.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use crate::dsa::falcon512::N;
use alloc::vec::Vec;

/// Encodes a sequence of signed integers such that each integer x satisfies |x| < 2^(bits-1)
/// for a given parameter bits. bits can take either the value 6 or 8.
Expand Down
3 changes: 2 additions & 1 deletion src/dsa/falcon512/math/ffsampling.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use super::{fft::FastFft, polynomial::Polynomial, samplerz::sampler_z, vec};
use super::{fft::FastFft, polynomial::Polynomial, samplerz::sampler_z};
use alloc::boxed::Box;
use num::{One, Zero};
use num_complex::{Complex, Complex64};
use rand::Rng;
Expand Down
3 changes: 2 additions & 1 deletion src/dsa/falcon512/math/fft.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use super::{field::FalconFelt, polynomial::Polynomial, vec, Inverse};
use super::{field::FalconFelt, polynomial::Polynomial, Inverse};
use alloc::vec::Vec;
use core::{
f64::consts::PI,
ops::{Add, AddAssign, Mul, MulAssign, Neg, Sub, SubAssign},
Expand Down
2 changes: 1 addition & 1 deletion src/dsa/falcon512/math/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use super::MODULUS;
use crate::utils::{collections::*, format, string::*, vec};
use alloc::{string::String, vec::Vec};
use core::ops::MulAssign;
use num::{BigInt, FromPrimitive, One, Zero};
use num_complex::Complex64;
Expand Down
3 changes: 2 additions & 1 deletion src/dsa/falcon512/math/polynomial.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use super::{field::FalconFelt, vec, Inverse};
use super::{field::FalconFelt, Inverse};
use crate::dsa::falcon512::{MODULUS, N};
use crate::Felt;
use alloc::vec::Vec;
use core::default::Default;
use core::fmt::Debug;
use core::ops::{Add, AddAssign, Div, Mul, MulAssign, Neg, Sub, SubAssign};
Expand Down
1 change: 1 addition & 0 deletions src/dsa/falcon512/math/samplerz.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ pub(crate) fn sampler_z<R: Rng>(mu: f64, sigma: f64, sigma_min: f64, rng: &mut R

#[cfg(test)]
mod test {
use alloc::vec::Vec;
use rand::RngCore;
use std::{thread::sleep, time::Duration};

Check failure on line 117 in src/dsa/falcon512/math/samplerz.rs

View workflow job for this annotation

GitHub Actions / test nightly on ubuntu with --no-default-features

failed to resolve: use of undeclared crate or module `std`

Check failure on line 117 in src/dsa/falcon512/math/samplerz.rs

View workflow job for this annotation

GitHub Actions / test stable on ubuntu with --no-default-features

failed to resolve: use of undeclared crate or module `std`

Expand Down
2 changes: 1 addition & 1 deletion src/dsa/falcon512/signature.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use alloc::{string::ToString, vec::Vec};
use core::ops::Deref;

use super::{
Expand All @@ -7,7 +8,6 @@ use super::{
ByteReader, ByteWriter, Deserializable, DeserializationError, Felt, Nonce, Rpo256,
Serializable, Word, LOG_N, MODULUS, N, SIG_L2_BOUND, SIG_LEN,
};
use crate::utils::string::*;
use num::Zero;

// FALCON SIGNATURE
Expand Down

0 comments on commit 0e17fb7

Please sign in to comment.