pub fn crypto_box_seal(msg: &[u8], pk: &[u8]) -> Vec<u8> {
    let mut esk = [0u8; 32];
    OsRng::new().expect("random works").fill_bytes(&mut esk);
    let epk = curve25519_base(&esk);

    let nonce = seal_nonce(&epk, pk);

    let res = crypto_box(msg, &nonce, pk, &esk);
    let mut vec = epk[..].to_owned();
    vec.extend(res);
    return vec;
}
/// Create a sealed (anonymous) crypto box
///
/// This should be compatible with libsodium
Create a sealed (anonymous) crypto box
This should be compatible with libsodium
Create a sealed ( anonymous ) crypto box This should be compatible with libsodium
pub fn crypto_box_seal(msg: &[u8], pk: &[u8]) -> Vec<u8> {
    let mut esk = [0u8; 32];
    OsRng::new().expect("random works").fill_bytes(&mut esk);
    let epk = curve25519_base(&esk);
    let nonce = seal_nonce(&epk, pk);
    let res = crypto_box(msg, &nonce, pk, &esk);
    let mut vec = epk[..].to_owned();
    vec.extend(res);
    return vec;
}
pub fn crypto_box_seal ( msg : & [ u8 ] , pk : & [ u8 ] ) -> Vec < u8 > { let mut esk = [ 0u8 ; 32 ] ; OsRng :: new ( ) . expect ( " " ) . fill_bytes ( & mut esk ) ; let epk = curve25519_base ( & esk ) ; let nonce = seal_nonce ( & epk , pk ) ; let res = crypto_box ( msg , & nonce , pk , & esk ) ; let mut vec = epk [ .. ] . to_owned ( ) ; vec . extend ( res ) ; return vec ; }
Create a sealed (anonymous) crypto box
This should be compatible with libsodium
Create a sealed ( anonymous ) crypto box This should be compatible with libsodium
msg
&[u8]
pk
&[u8]
msg
&[u8]
pk
&[u8]