Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ jobs:
command: check
args: --benches

- name: check (tests)
uses: actions-rs/cargo@v1
with:
command: check
args: --tests

- name: test
uses: actions-rs/cargo@v1
with:
Expand All @@ -45,6 +51,13 @@ jobs:
with:
command: clippy
args: --all-targets --all-features -- -Dwarnings

# test packaging to avoid surprisis at release time
- name: package
uses: actions-rs/cargo@v1
with:
command: package


build-wasm:
name: build wasm32
Expand Down
5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ criterion = { version= "0.4", features=["html_reports"] }
hex = "0.4"
pretty_assertions = "1.3"
rand = "0.8"
test_vectors = { version = "0.1.0", path = "utils/test_vectors" }
serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }
lazy_static = "1.4.0"


[features]
default = []
Expand Down
2 changes: 1 addition & 1 deletion src/crypto/aead.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ mod test {
}

mod test_vectors {
use test_vectors::get_test_vector;
use crate::test_vectors::get_test_vector;

use crate::{
crypto::{
Expand Down
2 changes: 1 addition & 1 deletion src/crypto/key_expansion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ mod ring {

#[cfg(test)]
mod test {
use test_vectors::get_test_vector;
use crate::test_vectors::get_test_vector;

use crate::{
crypto::{
Expand Down
2 changes: 1 addition & 1 deletion src/crypto/secret.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ impl Secret {

#[cfg(test)]
mod test {
use test_vectors::get_test_vector;
use crate::test_vectors::get_test_vector;

use crate::{
crypto::{cipher_suite::CipherSuiteVariant, key_expansion::KeyMaterial},
Expand Down
4 changes: 2 additions & 2 deletions src/header/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ mod test {

#[test]
fn serialize_test_vectors() {
test_vectors::get_test_vector(crate::CipherSuiteVariant::AesGcm128Sha256 as u8)
crate::test_vectors::get_test_vector(crate::CipherSuiteVariant::AesGcm128Sha256 as u8)
.encryptions
.iter()
.for_each(|test_vector| {
Expand All @@ -267,7 +267,7 @@ mod test {

#[test]
fn deserialize_test_vectors() {
test_vectors::get_test_vector(crate::CipherSuiteVariant::AesGcm256Sha512 as u8)
crate::test_vectors::get_test_vector(crate::CipherSuiteVariant::AesGcm256Sha512 as u8)
.encryptions
.iter()
.for_each(|test_vector| {
Expand Down
3 changes: 3 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,6 @@ pub mod header;
pub mod receiver;
pub mod sender;
pub use crypto::cipher_suite::CipherSuiteVariant;

#[cfg(test)]
pub mod test_vectors;
3 changes: 2 additions & 1 deletion utils/test_vectors/src/lib.rs → src/test_vectors/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Copyright (c) 2023 GoTo Group, Inc
// SPDX-License-Identifier: Apache-2.0 AND MIT
#![allow(clippy::missing_panics_doc)]

extern crate serde;

Expand Down Expand Up @@ -61,7 +62,7 @@ fn parse_test_vectors() -> Vec<TestVector> {

#[cfg(test)]
mod test {
use crate::get_test_vector;
use super::get_test_vector;

#[test]
fn should_parse_test_vectors() {
Expand Down
11 changes: 0 additions & 11 deletions utils/test_vectors/Cargo.toml

This file was deleted.