mirror of
https://github.com/kristoferssolo/cipher-workshop.git
synced 2025-12-20 11:04:38 +00:00
Initial commit
This commit is contained in:
commit
cb8128addf
19
.gitignore
vendored
Normal file
19
.gitignore
vendored
Normal file
@ -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
|
||||
18
Cargo.toml
Normal file
18
Cargo.toml
Normal file
@ -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"
|
||||
15
aes/Cargo.toml
Normal file
15
aes/Cargo.toml
Normal file
@ -0,0 +1,15 @@
|
||||
[package]
|
||||
name = "aes"
|
||||
version = "0.1.0"
|
||||
authors = ["Kristofers Solo <dev@kristofers.xyz>"]
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
|
||||
[dev-dependencies]
|
||||
claims.workspace = true
|
||||
rand.workspace = true
|
||||
rstest.workspace = true
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
14
aes/src/lib.rs
Normal file
14
aes/src/lib.rs
Normal file
@ -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);
|
||||
}
|
||||
}
|
||||
12
cipher-core/Cargo.toml
Normal file
12
cipher-core/Cargo.toml
Normal file
@ -0,0 +1,12 @@
|
||||
[package]
|
||||
name = "cipher-core"
|
||||
version = "0.1.0"
|
||||
authors = ["Kristofers Solo <dev@kristofers.xyz>"]
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
anyhow.workspace = true
|
||||
thiserror.workspace = true
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
14
cipher-core/src/lib.rs
Normal file
14
cipher-core/src/lib.rs
Normal file
@ -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);
|
||||
}
|
||||
}
|
||||
20
cli/Cargo.toml
Normal file
20
cli/Cargo.toml
Normal file
@ -0,0 +1,20 @@
|
||||
[package]
|
||||
name = "cli"
|
||||
version = "0.1.0"
|
||||
authors = ["Kristofers Solo <dev@kristofers.xyz>"]
|
||||
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
|
||||
3
cli/src/main.rs
Normal file
3
cli/src/main.rs
Normal file
@ -0,0 +1,3 @@
|
||||
fn main() {
|
||||
println!("Hello, world!");
|
||||
}
|
||||
15
des/Cargo.toml
Normal file
15
des/Cargo.toml
Normal file
@ -0,0 +1,15 @@
|
||||
[package]
|
||||
name = "des"
|
||||
version = "0.1.0"
|
||||
authors = ["Kristofers Solo <dev@kristofers.xyz>"]
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
|
||||
[dev-dependencies]
|
||||
claims.workspace = true
|
||||
rand.workspace = true
|
||||
rstest.workspace = true
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
14
des/src/lib.rs
Normal file
14
des/src/lib.rs
Normal file
@ -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);
|
||||
}
|
||||
}
|
||||
20
tui/Cargo.toml
Normal file
20
tui/Cargo.toml
Normal file
@ -0,0 +1,20 @@
|
||||
[package]
|
||||
name = "tui"
|
||||
version = "0.1.0"
|
||||
authors = ["Kristofers Solo <dev@kristofers.xyz>"]
|
||||
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
|
||||
3
tui/src/main.rs
Normal file
3
tui/src/main.rs
Normal file
@ -0,0 +1,3 @@
|
||||
fn main() {
|
||||
println!("Hello, world!");
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user