Skip to content

Commit

Permalink
fix: rmv comments and add acknowledgement
Browse files Browse the repository at this point in the history
  • Loading branch information
Al-Kindi-0 committed Mar 19, 2024
1 parent 2424b98 commit 3eaeb4b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
3 changes: 0 additions & 3 deletions src/dsa/rpo_falcon512/keys/secret_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ use num::{Complex, Zero};
use num_complex::Complex64;
use rand::{rngs::OsRng, Rng, RngCore};

//#[cfg(all(feature = "std", feature = "std_rng"))]

// CONSTANTS
// ================================================================================================

Expand Down Expand Up @@ -66,7 +64,6 @@ impl SecretKey {
pub fn new() -> Self {
let mut seed: [u8; 32] = [0; 32];
OsRng.fill_bytes(&mut seed);
//let rng: rand::rngs::StdRng = rand::SeedableRng::from_seed(seed);
Self::with_rng(&mut OsRng)
}

Expand Down
6 changes: 6 additions & 0 deletions src/dsa/rpo_falcon512/math/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
//! Contains different structs and methods related to the Falcon DSA.
//!
//! It uses and acknowledges the work in:
//!
//! 1. The [reference](https://falcon-sign.info/impl/README.txt.html) implementation by Thomas Pornin.
//! 2. The [Rust](https://github.com/aszepieniec/falcon-rust) implementation by Alan Szepieniec.
use super::MODULUS;
use alloc::{string::String, vec::Vec};
use core::ops::MulAssign;
Expand Down
6 changes: 3 additions & 3 deletions src/dsa/rpo_falcon512/signature.rs
Original file line number Diff line number Diff line change
Expand Up @@ -358,15 +358,15 @@ fn decompress_signature(input: &[u8]) -> Result<Polynomial<FalconFelt>, FalconSe
// TESTS
// ================================================================================================

#[cfg(all(test, feature = "std", feature = "std_rng"))]
#[cfg(test)]
mod tests {
use super::{super::SecretKey, *};
use rand::thread_rng;
use rand::rngs::OsRng;

#[test]
fn test_serialization_round_trip() {
let key = SecretKey::new();
let mut rng = thread_rng();
let mut rng = OsRng;
let signature = key.sign(Word::default(), &mut rng);
let serialized = signature.to_bytes();
let deserialized = Signature::read_from_bytes(&serialized).unwrap();
Expand Down

0 comments on commit 3eaeb4b

Please sign in to comment.