src/lib/encryption.js
function encryptAndSeal(plainText, AAD, nonce, key) {
    const cipherText =
        Sodium
            .crypto_stream_chacha20_xor_ic(plainText, nonce, 1, key);

    const hmac =
        computePoly1305(cipherText, AAD, nonce, key);

    return [ cipherText, hmac ];
}
function encryptAndSeal(plainText, AAD, nonce, key) {
    const cipherText =
        Sodium
            .crypto_stream_chacha20_xor_ic(plainText, nonce, 1, key);

    const hmac =
        computePoly1305(cipherText, AAD, nonce, key);

    return [ cipherText, hmac ];
}
function encryptAndSeal ( plainText , AAD , nonce , key ) { const cipherText = Sodium . crypto_stream_chacha20_xor_ic ( plainText , nonce , 1 , key ) ; const hmac = computePoly1305 ( cipherText , AAD , nonce , key ) ; return [ cipherText , hmac ] ; }
See above about calling directly into libsodium.
See above about calling directly into libsodium .