diff --git a/benches/benchmark_aes.rs b/benches/benchmark_aes.rs index 8310acb..85661f4 100644 --- a/benches/benchmark_aes.rs +++ b/benches/benchmark_aes.rs @@ -1,4 +1,4 @@ -use capycrypt::aes::aes_encryptable::AesEncryptable; +use capycrypt::aes::encryptable::AesEncryptable; use capycrypt::aes::aes_functions::{apply_pcks7_padding, remove_pcks7_padding}; use capycrypt::sha3::aux_functions::byte_utils::get_random_bytes; use capycrypt::Message; diff --git a/benches/benchmark_e448_224.rs b/benches/benchmark_e448_224.rs index acf10e3..a991fd1 100644 --- a/benches/benchmark_e448_224.rs +++ b/benches/benchmark_e448_224.rs @@ -1,8 +1,8 @@ -use capycrypt::ecc::ecc_encryptable::KeyEncryptable; -use capycrypt::ecc::ecc_keypair::KeyPair; -use capycrypt::ecc::ecc_signable::Signable; +use capycrypt::ecc::encryptable::KeyEncryptable; +use capycrypt::ecc::keypair::KeyPair; +use capycrypt::ecc::signable::Signable; use capycrypt::sha3::aux_functions::byte_utils::get_random_bytes; -use capycrypt::sha3::sponge_encryptable::SpongeEncryptable; +use capycrypt::sha3::encryptable::SpongeEncryptable; use capycrypt::SecParam::D224; use capycrypt::{Message, SecParam}; use criterion::{criterion_group, criterion_main, Criterion}; diff --git a/benches/benchmark_e448_512.rs b/benches/benchmark_e448_512.rs index 39155d7..3c45cfc 100644 --- a/benches/benchmark_e448_512.rs +++ b/benches/benchmark_e448_512.rs @@ -1,8 +1,8 @@ -use capycrypt::ecc::ecc_encryptable::KeyEncryptable; -use capycrypt::ecc::ecc_keypair::KeyPair; -use capycrypt::ecc::ecc_signable::Signable; +use capycrypt::ecc::encryptable::KeyEncryptable; +use capycrypt::ecc::keypair::KeyPair; +use capycrypt::ecc::signable::Signable; use capycrypt::sha3::aux_functions::byte_utils::get_random_bytes; -use capycrypt::sha3::sponge_encryptable::SpongeEncryptable; +use capycrypt::sha3::encryptable::SpongeEncryptable; use capycrypt::SecParam::D512; use capycrypt::{Message, SecParam}; use criterion::{criterion_group, criterion_main, Criterion}; diff --git a/benches/benchmark_sha3.rs b/benches/benchmark_sha3.rs index aa96f70..0f2dc9d 100644 --- a/benches/benchmark_sha3.rs +++ b/benches/benchmark_sha3.rs @@ -1,4 +1,4 @@ -use capycrypt::sha3::sha3_hashable::Hashable; +use capycrypt::sha3::hashable::Hashable; use capycrypt::{Message, SecParam}; use capycrypt::sha3::aux_functions::byte_utils::get_random_bytes; diff --git a/src/aes/aes_encryptable.rs b/src/aes/encryptable.rs similarity index 100% rename from src/aes/aes_encryptable.rs rename to src/aes/encryptable.rs diff --git a/src/ecc/ecc_encryptable.rs b/src/ecc/encryptable.rs similarity index 100% rename from src/ecc/ecc_encryptable.rs rename to src/ecc/encryptable.rs diff --git a/src/ecc/ecc_keypair.rs b/src/ecc/keypair.rs similarity index 100% rename from src/ecc/ecc_keypair.rs rename to src/ecc/keypair.rs diff --git a/src/ecc/ecc_signable.rs b/src/ecc/signable.rs similarity index 99% rename from src/ecc/ecc_signable.rs rename to src/ecc/signable.rs index fe91490..781b468 100644 --- a/src/ecc/ecc_signable.rs +++ b/src/ecc/signable.rs @@ -8,7 +8,7 @@ use crate::{ use serde::{Deserialize, Serialize}; use tiny_ed448_goldilocks::curve::{extended_edwards::ExtendedPoint, field::scalar::Scalar}; -use super::ecc_keypair::KeyPair; +use super::keypair::KeyPair; pub trait Signable { fn sign(&mut self, key: &KeyPair, d: &SecParam) -> Result<(), OperationError>; diff --git a/src/kem/kem_encryptable.rs b/src/kem/encryptable.rs similarity index 97% rename from src/kem/kem_encryptable.rs rename to src/kem/encryptable.rs index ada166d..311c0da 100644 --- a/src/kem/kem_encryptable.rs +++ b/src/kem/encryptable.rs @@ -11,7 +11,7 @@ use capy_kem::{ }; use rand::{thread_rng, RngCore}; -use super::kem_keypair::{KEMPrivateKey, KEMPublicKey}; +use super::keypair::{KEMPrivateKey, KEMPublicKey}; pub trait KEMEncryptable { fn kem_encrypt(&mut self, key: &KEMPublicKey, d: &SecParam) -> Result<(), OperationError>; diff --git a/src/kem/kem_keypair.rs b/src/kem/keypair.rs similarity index 100% rename from src/kem/kem_keypair.rs rename to src/kem/keypair.rs diff --git a/src/lib.rs b/src/lib.rs index b002e34..ca4336e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,5 +1,5 @@ #![warn(clippy::just_underscores_and_digits)] -use ecc::ecc_signable::Signature; +use ecc::signable::Signature; use serde::{Deserialize, Serialize}; use std::fs::File; use std::io::Read; @@ -36,28 +36,28 @@ pub mod sha3 { pub mod constants; /// Submodule that implements the Keccak-f[1600] permutation pub mod keccakf; - pub mod sha3_hashable; + pub mod hashable; pub mod shake_functions; /// Submodule that implements the sponge construction pub mod sponge; - pub mod sponge_encryptable; + pub mod encryptable; } pub mod aes { pub mod aes_constants; - pub mod aes_encryptable; pub mod aes_functions; + pub mod encryptable; } pub mod ecc { - pub mod ecc_encryptable; - pub mod ecc_keypair; - pub mod ecc_signable; + pub mod encryptable; + pub mod keypair; + pub mod signable; } pub mod kem { - pub mod kem_encryptable; - pub mod kem_keypair; + pub mod encryptable; + pub mod keypair; } #[derive(Clone, Serialize, Deserialize, Debug)] diff --git a/src/main.rs b/src/main.rs index 0a88be5..0b82ccb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,4 +1,4 @@ -use capycrypt::{ecc::ecc_keypair::KeyPair, sha3::sha3_hashable::Hashable, Message, SecParam}; +use capycrypt::{ecc::keypair::KeyPair, sha3::hashable::Hashable, Message, SecParam}; use structopt::StructOpt; #[derive(Debug, StructOpt)] diff --git a/src/sha3/sponge_encryptable.rs b/src/sha3/encryptable.rs similarity index 100% rename from src/sha3/sponge_encryptable.rs rename to src/sha3/encryptable.rs diff --git a/src/sha3/sha3_hashable.rs b/src/sha3/hashable.rs similarity index 100% rename from src/sha3/sha3_hashable.rs rename to src/sha3/hashable.rs diff --git a/src/sha3/shake_functions.rs b/src/sha3/shake_functions.rs index fc7c53a..1f3437c 100644 --- a/src/sha3/shake_functions.rs +++ b/src/sha3/shake_functions.rs @@ -112,7 +112,7 @@ pub fn kmac_xof( /// TESTS #[cfg(test)] mod shake_tests { - use crate::{sha3::sha3_hashable::Hashable, Message, SecParam}; + use crate::{sha3::hashable::Hashable, Message, SecParam}; #[test] fn test_shake_224() { diff --git a/tests/aes_tests.rs b/tests/aes_tests.rs index c72b858..7af64a7 100644 --- a/tests/aes_tests.rs +++ b/tests/aes_tests.rs @@ -1,6 +1,6 @@ #[cfg(test)] mod aes_modes_tests { - use capycrypt::aes::aes_encryptable::AesEncryptable; + use capycrypt::aes::encryptable::AesEncryptable; use capycrypt::sha3::aux_functions::byte_utils::get_random_bytes; use capycrypt::Message; diff --git a/tests/integration_tests.rs b/tests/integration_tests.rs index 3882ca6..4461c41 100644 --- a/tests/integration_tests.rs +++ b/tests/integration_tests.rs @@ -4,10 +4,10 @@ pub mod ops_tests { use tempfile::tempdir; use capycrypt::{ - ecc::{ecc_encryptable::KeyEncryptable, ecc_keypair::KeyPair, ecc_signable::Signable}, - kem::{kem_encryptable::KEMEncryptable, kem_keypair::kem_keygen}, + ecc::{encryptable::KeyEncryptable, keypair::KeyPair, signable::Signable}, + kem::{encryptable::KEMEncryptable, keypair::kem_keygen}, sha3::{ - aux_functions::byte_utils::get_random_bytes, sponge_encryptable::SpongeEncryptable, + aux_functions::byte_utils::get_random_bytes, encryptable::SpongeEncryptable, }, Message, SecParam, }; @@ -198,10 +198,10 @@ pub mod ops_tests { #[cfg(test)] mod decryption_test { - use capycrypt::ecc::ecc_encryptable::KeyEncryptable; - use capycrypt::ecc::ecc_keypair::KeyPair; + use capycrypt::ecc::encryptable::KeyEncryptable; + use capycrypt::ecc::keypair::KeyPair; use capycrypt::sha3::aux_functions::byte_utils::get_random_bytes; - use capycrypt::sha3::sponge_encryptable::SpongeEncryptable; + use capycrypt::sha3::encryptable::SpongeEncryptable; use capycrypt::Message; use capycrypt::SecParam::D512;