...
This commit is contained in:
16
crates/libcrypto/Cargo.toml
Normal file
16
crates/libcrypto/Cargo.toml
Normal file
@@ -0,0 +1,16 @@
|
||||
[package]
|
||||
name = "libcrypto"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
chacha20poly1305 = "0.10"
|
||||
rand = { workspace = true }
|
||||
sha2 = { workspace = true }
|
||||
thiserror = { workspace = true }
|
||||
|
||||
# Add this dependency for the From<CryptoError> for DBError
|
||||
libdbstorage = { path = "../libdbstorage", optional = true }
|
||||
|
||||
[features]
|
||||
storage_compat = ["dep:libdbstorage"]
|
14
crates/libcrypto/src/lib.rs
Normal file
14
crates/libcrypto/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);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user