Expand description
lib SOdium + haDOKEN = SODOKEN!
Thin wrapper around libsodium-sys-stable.
use sodoken::*;
let mut pub_key = [0; sign::PUBLICKEYBYTES];
let mut sec_key = SizedLockedArray::new().unwrap();
sign::keypair(&mut pub_key, &mut sec_key.lock()).unwrap();
let mut sig = [0; sign::SIGNATUREBYTES];
sign::sign_detached(&mut sig, b"hello", &sec_key.lock()).unwrap();
assert!(sign::verify_detached(&sig, b"hello", &pub_key));
assert!(!sign::verify_detached(&sig, b"world", &pub_key));Modules§
- argon2
- Api functions related to the argon2id password hashing algorithm.
- blake2b
- Api functions related to the blake2b generichash algorithm.
- crypto_
box - Modules related to cryptographic box encryption / decryption.
- kdf
- Api functions related to cryptographically secure key derivation.
- kx
- Api functions related to cryptographically secure key exchange.
- random
- Libsodium random types and functions.
- secretbox
- Modules related to cryptographic secretbox encryption / decryption.
- secretstream
- Modules related to secret stream encryption / decryption.
- sign
- Api functions related to cryptographic signatures and verification.
Structs§
- Locked
Array - Locked memory.
- Locked
Array Guard - Locked memory that is unlocked for access.
- Sized
Locked Array - Locked memory with a size known at compile time.
- Sized
Locked Array Guard - Locked memory that is unlocked for access.