Skip to content

Commit

Permalink
test(kyberlib): ✅ add new tests for lib.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastienrousseau committed May 8, 2024
1 parent 5d78610 commit b965213
Show file tree
Hide file tree
Showing 19 changed files with 504 additions and 18 deletions.
2 changes: 1 addition & 1 deletion benches/bench.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2023 KyberLib. All rights reserved.
// Copyright © 2024 kyberlib. All rights reserved.
// SPDX-License-Identifier: Apache-2.0 OR MIT

//! This crate is responsible for benchmarking various components of the application.
Expand Down
2 changes: 1 addition & 1 deletion src/api.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2023 KyberLib. All rights reserved.
// Copyright © 2024 kyberlib. All rights reserved.
// SPDX-License-Identifier: Apache-2.0 OR MIT

use crate::{
Expand Down
2 changes: 1 addition & 1 deletion src/error.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2023 KyberLib. All rights reserved.
// Copyright © 2024 kyberlib. All rights reserved.
// SPDX-License-Identifier: Apache-2.0 OR MIT

/// Error types for the failure modes in Kyber key exchange.
Expand Down
2 changes: 1 addition & 1 deletion src/kem.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2023 KyberLib. All rights reserved.
// Copyright © 2024 kyberlib. All rights reserved.
// SPDX-License-Identifier: Apache-2.0 OR MIT

use crate::{
Expand Down
2 changes: 1 addition & 1 deletion src/kex.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2023 KyberLib. All rights reserved.
// Copyright © 2024 kyberlib. All rights reserved.
// SPDX-License-Identifier: Apache-2.0 OR MIT

use crate::{kem::*, params::*, symmetric::kdf, KyberLibError};
Expand Down
3 changes: 2 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2023 KyberLib. All rights reserved.
// Copyright © 2024 kyberlib. All rights reserved.
// SPDX-License-Identifier: Apache-2.0 OR MIT

//! # `KyberLib` 🦀
Expand Down Expand Up @@ -144,6 +144,7 @@ mod avx2;
use avx2::*;

#[cfg(any(not(target_arch = "x86_64"), not(feature = "avx2")))]
/// Reference implementation for the KyberLib library.
pub mod reference;
#[cfg(any(not(target_arch = "x86_64"), not(feature = "avx2")))]
use reference::*;
Expand Down
2 changes: 1 addition & 1 deletion src/macros.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2023 KyberLib. All rights reserved.
// Copyright © 2024 kyberlib. All rights reserved.
// SPDX-License-Identifier: Apache-2.0 OR MIT

//! # KyberLib Macros
Expand Down
2 changes: 1 addition & 1 deletion src/params.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2023 KyberLib. All rights reserved.
// Copyright © 2024 kyberlib. All rights reserved.
// SPDX-License-Identifier: Apache-2.0 OR MIT

// Constants and parameters used in the Kyber cryptographic scheme.
Expand Down
2 changes: 1 addition & 1 deletion src/rng.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2023 KyberLib. All rights reserved.
// Copyright © 2024 kyberlib. All rights reserved.
// SPDX-License-Identifier: Apache-2.0 OR MIT

use crate::KyberLibError;
Expand Down
4 changes: 3 additions & 1 deletion src/symmetric.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2023 KyberLib. All rights reserved.
// Copyright © 2024 kyberlib. All rights reserved.
// SPDX-License-Identifier: Apache-2.0 OR MIT

#![allow(dead_code)]
Expand Down Expand Up @@ -42,7 +42,9 @@ pub type XofState = Aes256CtrCtx;
/// Keccak state for absorbing data
#[derive(Copy, Clone, Debug, Default)]

Check warning on line 43 in src/symmetric.rs

View check run for this annotation

Codecov / codecov/patch

src/symmetric.rs#L43

Added line #L43 was not covered by tests
pub struct KeccakState {
/// State array for Keccak
pub s: [u64; 25],

Check warning on line 46 in src/symmetric.rs

View check run for this annotation

Codecov / codecov/patch

src/symmetric.rs#L46

Added line #L46 was not covered by tests
/// Position in the state array
pub pos: usize,

Check warning on line 48 in src/symmetric.rs

View check run for this annotation

Codecov / codecov/patch

src/symmetric.rs#L48

Added line #L48 was not covered by tests
}

Expand Down
2 changes: 1 addition & 1 deletion src/wasm.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2023 KyberLib. All rights reserved.
// Copyright © 2024 kyberlib. All rights reserved.
// SPDX-License-Identifier: Apache-2.0 OR MIT

#![allow(non_snake_case)]
Expand Down
2 changes: 1 addition & 1 deletion tests/test_error.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2023 kyberlib. All rights reserved.
// Copyright © 2024 kyberlib. All rights reserved.
// SPDX-License-Identifier: Apache-2.0 OR MIT

#![cfg(test)]
Expand Down
Loading

0 comments on commit b965213

Please sign in to comment.