-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
38 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#![allow(warnings)] | ||
#[cfg(test)] | ||
mod indcpa_tests { | ||
use crate::{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#![allow(warnings)] | ||
#[cfg(test)] | ||
|
||
pub(in crate::tests) mod sample_tests { | ||
use crate::{ | ||
polynomials::*, | ||
params::*, | ||
tests::{ | ||
polynomials::poly_tests::*, | ||
params::params_tests::sec_level_strategy, | ||
}, | ||
}; | ||
use proptest::prelude::*; | ||
|
||
proptest! { | ||
#[test] | ||
fn derive_noise_test( | ||
seed in prop::array::uniform32(u8::MIN..u8::MAX), | ||
nonce in (u8::MIN..u8::MAX), | ||
sec_level in sec_level_strategy(), | ||
) { | ||
let poly_1 = Poly::derive_noise(&seed, nonce, sec_level.eta_1()); | ||
let poly_2 = Poly::derive_noise(&seed, nonce, sec_level.eta_2()); | ||
} | ||
|
||
#[test] | ||
fn derive_uniform_test( | ||
seed in prop::array::uniform32(u8::MIN..u8::MAX), | ||
x in (u8::MIN..u8::MAX), | ||
y in (u8::MIN..u8::MAX), | ||
) { | ||
let poly = Poly::derive_uniform(&seed, x, y).unwrap(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters