use sodiumoxide;
use sodiumoxide::randombytes;
use sodiumoxide::crypto::hash::sha256;
mod keypair;
mod strkey;
mod ecdh;
mod sha;
pub use self::keypair::{KeyPair, PublicKey, SecretKey};
pub use self::ecdh::{Curve25519Public, Curve25519Secret};
pub use self::sha::{HmacSha256Key, HmacSha256Mac};
pub fn hash(m: &[u8]) -> Vec<u8> {
let digest = sha256::hash(&m);
digest.0.to_vec()
}
pub fn random_bytes(size: usize) -> Vec<u8> {
randombytes::randombytes(size)
}
pub fn init() -> bool {
sodiumoxide::init()
}