Skip to content

Commit

Permalink
revert
Browse files Browse the repository at this point in the history
  • Loading branch information
s0l0ist committed Mar 4, 2024
1 parent 11053b9 commit 02f1cb1
Showing 1 changed file with 14 additions and 42 deletions.
56 changes: 14 additions & 42 deletions tests/paillier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ fn b10(s: &str) -> BigNumber {
BigNumber::from_slice(bytes.as_slice())
}

#[cfg_attr(feature = "wasm", wasm_bindgen_test::wasm_bindgen_test)]
#[test]
fn encrypt() {
let res = DecryptionKey::with_primes_unchecked(&b10(TEST_PRIMES[0]), &b10(TEST_PRIMES[1]));
assert!(res.is_some());
Expand Down Expand Up @@ -45,6 +47,8 @@ fn encrypt() {
}
}

#[cfg_attr(feature = "wasm", wasm_bindgen_test::wasm_bindgen_test)]
#[test]
fn add() {
let res = DecryptionKey::with_primes_unchecked(&b10(TEST_PRIMES[0]), &b10(TEST_PRIMES[1]));
assert!(res.is_some());
Expand All @@ -71,6 +75,8 @@ fn add() {
assert_eq!(m3, BigNumber::from(13));
}

#[cfg_attr(feature = "wasm", wasm_bindgen_test::wasm_bindgen_test)]
#[test]
fn mul() {
let res = DecryptionKey::with_primes_unchecked(&b10(TEST_PRIMES[0]), &b10(TEST_PRIMES[1]));
assert!(res.is_some());
Expand All @@ -94,6 +100,8 @@ fn mul() {
assert_eq!(m3, BigNumber::from(42));
}

#[cfg_attr(feature = "wasm", wasm_bindgen_test::wasm_bindgen_test)]
#[test]
fn serialization() {
let res = DecryptionKey::with_primes_unchecked(&b10(TEST_PRIMES[2]), &b10(TEST_PRIMES[3]));
assert!(res.is_some());
Expand Down Expand Up @@ -127,6 +135,8 @@ fn serialization() {
assert_eq!(sk.n(), sk1.n());
}

#[cfg_attr(feature = "wasm", wasm_bindgen_test::wasm_bindgen_test)]
#[test]
fn bytes() {
let res = DecryptionKey::with_primes_unchecked(&b10(TEST_PRIMES[2]), &b10(TEST_PRIMES[3]));
assert!(res.is_some());
Expand All @@ -149,6 +159,8 @@ fn bytes() {
assert_eq!(sk.n(), sk1.n());
}

#[cfg_attr(feature = "wasm", wasm_bindgen_test::wasm_bindgen_test)]
#[test]
fn proof() {
use k256::elliptic_curve::group::prime::PrimeCurveAffine;

Expand Down Expand Up @@ -188,6 +200,8 @@ fn proof() {
assert!(res.is_err());
}

#[cfg_attr(feature = "wasm", wasm_bindgen_test::wasm_bindgen_test)]
#[test]
fn all() {
let res = DecryptionKey::random();
assert!(res.is_some());
Expand Down Expand Up @@ -215,45 +229,3 @@ fn all() {
assert!(res.is_none());
}
}

#[cfg_attr(feature = "wasm", wasm_bindgen_test::wasm_bindgen_test)]
#[test]
fn test_encrypt() {
encrypt()
}

#[cfg_attr(feature = "wasm", wasm_bindgen_test::wasm_bindgen_test)]
#[test]
fn test_add() {
add()
}

#[cfg_attr(feature = "wasm", wasm_bindgen_test::wasm_bindgen_test)]
#[test]
fn test_mul() {
mul()
}

#[cfg_attr(feature = "wasm", wasm_bindgen_test::wasm_bindgen_test)]
#[test]
fn test_serialization() {
serialization()
}

#[cfg_attr(feature = "wasm", wasm_bindgen_test::wasm_bindgen_test)]
#[test]
fn test_bytes() {
bytes()
}

#[cfg_attr(feature = "wasm", wasm_bindgen_test::wasm_bindgen_test)]
#[test]
fn test_proof() {
proof()
}

#[cfg_attr(feature = "wasm", wasm_bindgen_test::wasm_bindgen_test)]
#[test]
fn test_all() {
all()
}

0 comments on commit 02f1cb1

Please sign in to comment.