Crate sodoken

Crate sodoken 

Source
Expand description

lib SOdium + haDOKEN = SODOKEN!

Thin wrapper around libsodium-sys-stable.

Project Forum Chat

License: MIT License: Apache-2.0

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§

LockedArray
Locked memory.
LockedArrayGuard
Locked memory that is unlocked for access.
SizedLockedArray
Locked memory with a size known at compile time.
SizedLockedArrayGuard
Locked memory that is unlocked for access.