commit cb8128addf61d03fd6b70d6917cb7162ee350be7 Author: Kristofers Solo Date: Mon Oct 13 12:49:49 2025 +0300 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1efa08b --- /dev/null +++ b/.gitignore @@ -0,0 +1,19 @@ +#--------------------------------------------------# +# The following was generated with gitignore.nvim: # +#--------------------------------------------------# +# Gitignore for the following technologies: Rust + +# Generated by Cargo +# will have compiled files and executables +debug/ +target/ + +# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries +# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html +Cargo.lock + +# These are backup files generated by rustfmt +**/*.rs.bk + +# MSVC Windows builds of rustc generate these, which store debugging information +*.pdb diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..9c3c86a --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,18 @@ +[workspace] +resolver = "2" +members = ["aes", "cipher-core", "cli", "des", "tui"] + +[workspace.dependencies] +aes = { path = "aes" } +anyhow = "1" +cipher-core = { path = "cipher-core" } +claims = "0.8" +des = { path = "des" } +rand = "0.9" +rstest = "0.26" +thiserror = "2" + +[workspace.lints.clippy] +pedantic = "warn" +nursery = "warn" +unwrap_used = "warn" diff --git a/aes/Cargo.toml b/aes/Cargo.toml new file mode 100644 index 0000000..c669632 --- /dev/null +++ b/aes/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "aes" +version = "0.1.0" +authors = ["Kristofers Solo "] +edition = "2024" + +[dependencies] + +[dev-dependencies] +claims.workspace = true +rand.workspace = true +rstest.workspace = true + +[lints] +workspace = true diff --git a/aes/src/lib.rs b/aes/src/lib.rs new file mode 100644 index 0000000..b93cf3f --- /dev/null +++ b/aes/src/lib.rs @@ -0,0 +1,14 @@ +pub fn add(left: u64, right: u64) -> u64 { + left + right +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn it_works() { + let result = add(2, 2); + assert_eq!(result, 4); + } +} diff --git a/cipher-core/Cargo.toml b/cipher-core/Cargo.toml new file mode 100644 index 0000000..42260cf --- /dev/null +++ b/cipher-core/Cargo.toml @@ -0,0 +1,12 @@ +[package] +name = "cipher-core" +version = "0.1.0" +authors = ["Kristofers Solo "] +edition = "2024" + +[dependencies] +anyhow.workspace = true +thiserror.workspace = true + +[lints] +workspace = true diff --git a/cipher-core/src/lib.rs b/cipher-core/src/lib.rs new file mode 100644 index 0000000..b93cf3f --- /dev/null +++ b/cipher-core/src/lib.rs @@ -0,0 +1,14 @@ +pub fn add(left: u64, right: u64) -> u64 { + left + right +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn it_works() { + let result = add(2, 2); + assert_eq!(result, 4); + } +} diff --git a/cli/Cargo.toml b/cli/Cargo.toml new file mode 100644 index 0000000..f70570f --- /dev/null +++ b/cli/Cargo.toml @@ -0,0 +1,20 @@ +[package] +name = "cli" +version = "0.1.0" +authors = ["Kristofers Solo "] +edition = "2024" + +[dependencies] +aes = { workspace = true, optional = true } +anyhow.workspace = true +clap = { version = "4.5", features = ["derive"] } +des = { workspace = true, optional = true } +thiserror.workspace = true + +[features] +default = ["des", "aes"] +des = ["dep:des"] +aes = ["dep:aes"] + +[lints] +workspace = true diff --git a/cli/src/main.rs b/cli/src/main.rs new file mode 100644 index 0000000..e7a11a9 --- /dev/null +++ b/cli/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Hello, world!"); +} diff --git a/des/Cargo.toml b/des/Cargo.toml new file mode 100644 index 0000000..c9cd878 --- /dev/null +++ b/des/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "des" +version = "0.1.0" +authors = ["Kristofers Solo "] +edition = "2024" + +[dependencies] + +[dev-dependencies] +claims.workspace = true +rand.workspace = true +rstest.workspace = true + +[lints] +workspace = true diff --git a/des/src/lib.rs b/des/src/lib.rs new file mode 100644 index 0000000..b93cf3f --- /dev/null +++ b/des/src/lib.rs @@ -0,0 +1,14 @@ +pub fn add(left: u64, right: u64) -> u64 { + left + right +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn it_works() { + let result = add(2, 2); + assert_eq!(result, 4); + } +} diff --git a/tui/Cargo.toml b/tui/Cargo.toml new file mode 100644 index 0000000..426e707 --- /dev/null +++ b/tui/Cargo.toml @@ -0,0 +1,20 @@ +[package] +name = "tui" +version = "0.1.0" +authors = ["Kristofers Solo "] +edition = "2024" + +[dependencies] +aes = { workspace = true, optional = true } +anyhow.workspace = true +des = { workspace = true, optional = true } +ratatui = "0.29" +thiserror.workspace = true + +[features] +default = ["des", "aes"] +des = ["dep:des"] +aes = ["dep:aes"] + +[lints] +workspace = true diff --git a/tui/src/main.rs b/tui/src/main.rs new file mode 100644 index 0000000..e7a11a9 --- /dev/null +++ b/tui/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Hello, world!"); +}