pub fn crypto_box(msg: &[u8], nonce: &[u8], pk: &[u8], sk: &[u8]) -> Vec<u8> {
    assert!(nonce.len() == crypto_box_NONCEBYTES);

    let key = crypto_box_setup(pk, sk);
    return crypto_secretbox(msg, nonce, &key);
}
/// Public-key authenticated encryption.
///
/// The crypto_box function encrypts and authenticates a message, using the
/// sender's secret key, the receiver's public key, and a nonce, returning
/// the corresponding ciphertext.  This function asserts if pk.len() is not
/// crypto_box_PUBLICKEYBYTES, sk.len() is not crypto_box_SECRETKEYBYTES,
/// or if nonce.len() is not crypto_secretbox_NONCEBYTES.
///
/// Nonces MUST NOT be reused with a given pk/sk pair.  Nonces are long enough
/// that randomly generated nonces have negligible risk of collision.
///
/// # Arguments
/// * msg - The plaintext to encrypt/authenticate.
/// * nonce - The nonce to use for the encryption/authentication.
/// * pk - The receiver's public key.
/// * sk - The sender's secret (private) key.
Public-key authenticated encryption.
The crypto_box function encrypts and authenticates a message, using the
sender's secret key, the receiver's public key, and a nonce, returning
the corresponding ciphertext.  This function asserts if pk.len() is not
crypto_box_PUBLICKEYBYTES, sk.len() is not crypto_box_SECRETKEYBYTES,
or if nonce.len() is not crypto_secretbox_NONCEBYTES.

Nonces MUST NOT be reused with a given pk/sk pair.  Nonces are long enough
that randomly generated nonces have negligible risk of collision.
Public - key authenticated encryption . The crypto_box function encrypts and authenticates a message using the sender ' s secret key the receiver ' s public key and a nonce returning the corresponding ciphertext . This function asserts if pk . len () is not crypto_box_PUBLICKEYBYTES sk . len () is not crypto_box_SECRETKEYBYTES or if nonce . len () is not crypto_secretbox_NONCEBYTES . Nonces MUST NOT be reused with a given pk / sk pair . Nonces are long enough that randomly generated nonces have negligible risk of collision .
pub fn crypto_box(msg: &[u8], nonce: &[u8], pk: &[u8], sk: &[u8]) -> Vec<u8> {
    assert!(nonce.len() == crypto_box_NONCEBYTES);
    let key = crypto_box_setup(pk, sk);
    return crypto_secretbox(msg, nonce, &key);
}
pub fn crypto_box ( msg : & [ u8 ] , nonce : & [ u8 ] , pk : & [ u8 ] , sk : & [ u8 ] ) -> Vec < u8 > { assert ! ( nonce len ( ) crypto_box_NONCEBYTES ) ; let key = crypto_box_setup ( pk , sk ) ; return crypto_secretbox ( msg , nonce , & key ) ; }
Public-key authenticated encryption.
Public - key authenticated encryption .
msg
&[u8]
nonce
&[u8]
pk
&[u8]
sk
&[u8]
msg
&[u8]
nonce
&[u8]
pk
&[u8]
sk
&[u8]