sodoken

Crates.iosodoken
lib.rssodoken
version0.0.901-alpha
sourcesrc
created_at2020-12-17 18:52:03.419136
updated_at2024-04-26 17:41:08.157871
descriptionlibsodium wrapper providing tokio safe memory secure api access.
homepage
repositoryhttps://github.com/holochain/sodoken
max_upload_size
id323998
size246,991
Core Dev (github:holochain:core-dev)

documentation

https://docs.rs/sodoken

README

sodoken

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 = LockedArray::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));
Commit count: 74

cargo fmt