Source: readable_api.js

var HaclWasm = require('../api.js');
/**
 * Hacl bindings for Javascript using WebAssembly.
 * @module Hacl
 */

/**
 * @namespace Curve25519_51
 */
var  Curve25519_51 = {


/**
 * @param {buffer} scalar - size 32
 * @param {buffer} input - size 32
 * @return {bool}
 * @return {buffer} result - size 32
 */
ecdh: function(scalar,input,) { ecdh: HaclWasm.Curve25519_51.ecdh.apply(null, arguments) },


/**
 * @param {buffer} scalar - size 32
 * @return {buffer} result - size 32
 */
secret_to_public: function(scalar,) { secret_to_public: HaclWasm.Curve25519_51.secret_to_public.apply(null, arguments) },


/**
 * @param {buffer} scalar - size 32
 * @param {buffer} input - size 32
 * @return {buffer} result - size 32
 */
scalarmult: function(scalar,input,) { scalarmult: HaclWasm.Curve25519_51.scalarmult.apply(null, arguments) },
}
module.exports.Curve25519_51 = Curve25519_51


/**
 * @namespace Chacha20Poly1305
 */
var  Chacha20Poly1305 = {


/**
 * @param {buffer} key - size 32
 * @param {buffer} nonce - size 12
 * @param {buffer} aad - size alen
 * @param {buffer} plaintext - size len
 * @return {buffer} ciphertext - size len
 * @return {buffer} mac - size 16
 */
aead_encrypt: function(key,nonce,aad,plaintext,) { aead_encrypt: HaclWasm.Chacha20Poly1305.aead_encrypt.apply(null, arguments) },


/**
 * @param {buffer} key - size 32
 * @param {buffer} nonce - size 12
 * @param {buffer} aad - size alen
 * @param {buffer} ciphertext - size len
 * @param {buffer} mac - size 16
 * @return {int}
 * @return {buffer} plaintext - size len
 */
aead_decrypt: function(key,nonce,aad,ciphertext,mac,) { aead_decrypt: HaclWasm.Chacha20Poly1305.aead_decrypt.apply(null, arguments) },
}
module.exports.Chacha20Poly1305 = Chacha20Poly1305


/**
 * @namespace Ed25519
 */
var  Ed25519 = {


/**
 * @param {buffer} priv - size 32
 * @return {buffer} pub - size 32
 */
secret_to_public: function(priv,) { secret_to_public: HaclWasm.Ed25519.secret_to_public.apply(null, arguments) },


/**
 * @param {buffer} priv - size 32
 * @param {buffer} message - size len
 * @return {buffer} signature - size 64
 */
sign: function(priv,message,) { sign: HaclWasm.Ed25519.sign.apply(null, arguments) },


/**
 * @param {buffer} pub - size 32
 * @param {buffer} message - size len
 * @param {buffer} signature - size 64
 * @return {bool}
 */
verify: function(pub,message,signature,) { verify: HaclWasm.Ed25519.verify.apply(null, arguments) },
}
module.exports.Ed25519 = Ed25519


/**
 * @namespace SHA2
 */
var  SHA2 = {


/**
 * @param {buffer} input - size input_len
 * @return {buffer} hash - size 64
 */
hash_512: function(input,) { hash_512: HaclWasm.SHA2.hash_512.apply(null, arguments) },


/**
 * @param {buffer} input - size input_len
 * @return {buffer} hash - size 48
 */
hash_384: function(input,) { hash_384: HaclWasm.SHA2.hash_384.apply(null, arguments) },


/**
 * @param {buffer} input - size input_len
 * @return {buffer} hash - size 32
 */
hash_256: function(input,) { hash_256: HaclWasm.SHA2.hash_256.apply(null, arguments) },
}
module.exports.SHA2 = SHA2


/**
 * @namespace Blake2
 */
var  Blake2 = {


/**
 * @param {int} output_len
 * @param {buffer} data - size data_len
 * @param {buffer} key - size key_len
 * @return {buffer} output - size output_len
 */
blake2b: function(output_len,data,key,) { blake2b: HaclWasm.Blake2.blake2b.apply(null, arguments) },


/**
 * @param {int} output_len
 * @param {buffer} data - size data_len
 * @param {buffer} key - size key_len
 * @return {buffer} output - size output_len
 */
blake2s: function(output_len,data,key,) { blake2s: HaclWasm.Blake2.blake2s.apply(null, arguments) },
}
module.exports.Blake2 = Blake2


/**
 * @namespace SHA3
 */
var  SHA3 = {


/**
 * @param {buffer} input - size input_len
 * @return {buffer} hash - size 64
 */
hash_512: function(input,) { hash_512: HaclWasm.SHA3.hash_512.apply(null, arguments) },


/**
 * @param {buffer} input - size input_len
 * @return {buffer} hash - size 48
 */
hash_384: function(input,) { hash_384: HaclWasm.SHA3.hash_384.apply(null, arguments) },


/**
 * @param {buffer} input - size input_len
 * @return {buffer} hash - size 32
 */
hash_256: function(input,) { hash_256: HaclWasm.SHA3.hash_256.apply(null, arguments) },


/**
 * @param {buffer} input - size input_len
 * @return {buffer} hash - size 28
 */
hash_224: function(input,) { hash_224: HaclWasm.SHA3.hash_224.apply(null, arguments) },


/**
 * @param {int} rate
 * @param {int} capacity
 * @param {buffer} input - size input_len
 * @param {int} suffix
 * @param {int} output_len
 * @return {buffer} digest - size output_len
 */
keccak: function(rate,capacity,input,suffix,output_len,) { keccak: HaclWasm.SHA3.keccak.apply(null, arguments) },
}
module.exports.SHA3 = SHA3


/**
 * @namespace HMAC
 */
var  HMAC = {


/**
 * @param {buffer} key - size key_len
 * @param {buffer} data - size data_len
 * @return {buffer} tag - size 32
 */
sha256: function(key,data,) { sha256: HaclWasm.HMAC.sha256.apply(null, arguments) },


/**
 * @param {buffer} key - size key_len
 * @param {buffer} data - size data_len
 * @return {buffer} tag - size 64
 */
sha512: function(key,data,) { sha512: HaclWasm.HMAC.sha512.apply(null, arguments) },
}
module.exports.HMAC = HMAC


/**
 * @namespace HKDF
 */
var  HKDF = {


/**
 * @param {buffer} salt - size salt_len
 * @param {buffer} ikm - size ikm_len
 * @return {buffer} prk - size 32
 */
extract_sha2_256: function(salt,ikm,) { extract_sha2_256: HaclWasm.HKDF.extract_sha2_256.apply(null, arguments) },


/**
 * @param {buffer} prk - size prk_len
 * @param {buffer} info - size infolen
 * @param {int} len
 * @return {buffer} okm - size len
 */
expand_sha2_256: function(prk,info,len,) { expand_sha2_256: HaclWasm.HKDF.expand_sha2_256.apply(null, arguments) },
}
module.exports.HKDF = HKDF


/**
 * @namespace NaCl
 */
var  NaCl = {


/**
 * @param {buffer} m - size mlen
 * @param {buffer} n - size 24
 * @param {buffer} k - size 32
 * @return {int}
 * @return {buffer} c - size mlen+16
 */
secretbox_easy: function(m,n,k,) { secretbox_easy: HaclWasm.NaCl.secretbox_easy.apply(null, arguments) },


/**
 * @param {buffer} c - size clen
 * @param {buffer} n - size 24
 * @param {buffer} k - size 32
 * @return {int}
 * @return {buffer} m - size clen-16
 */
secretbox_open_easy: function(c,n,k,) { secretbox_open_easy: HaclWasm.NaCl.secretbox_open_easy.apply(null, arguments) },


/**
 * @param {buffer} pk - size 32
 * @param {buffer} sk - size 32
 * @return {int}
 * @return {buffer} k - size 32
 */
box_beforenm: function(pk,sk,) { box_beforenm: HaclWasm.NaCl.box_beforenm.apply(null, arguments) },


/**
 * @param {buffer} m - size mlen
 * @param {buffer} n - size 24
 * @param {buffer} k - size 32
 * @return {int}
 * @return {buffer} c - size mlen+16
 */
box_easy_afternm: function(m,n,k,) { box_easy_afternm: HaclWasm.NaCl.box_easy_afternm.apply(null, arguments) },


/**
 * @param {buffer} c - size clen
 * @param {buffer} n - size 24
 * @param {buffer} k - size 32
 * @return {int}
 * @return {buffer} m - size clen-16
 */
box_open_easy_afternm: function(c,n,k,) { box_open_easy_afternm: HaclWasm.NaCl.box_open_easy_afternm.apply(null, arguments) },


/**
 * @param {buffer} m - size mlen
 * @param {buffer} n - size 24
 * @param {buffer} k - size 32
 * @return {int}
 * @return {buffer} c - size mlen
 * @return {buffer} tag - size 16
 */
box_detached_afternm: function(m,n,k,) { box_detached_afternm: HaclWasm.NaCl.box_detached_afternm.apply(null, arguments) },


/**
 * @param {buffer} c - size mlen
 * @param {buffer} tag - size 16
 * @param {buffer} n - size 24
 * @param {buffer} k - size 32
 * @return {int}
 * @return {buffer} m - size mlen
 */
box_open_detached_afternm: function(c,tag,n,k,) { box_open_detached_afternm: HaclWasm.NaCl.box_open_detached_afternm.apply(null, arguments) },
}
module.exports.NaCl = NaCl


/**
 * @namespace P256
 */
var  P256 = {


/**
 * @param {buffer} m - size mlen
 * @param {buffer} privkey - size 32
 * @param {buffer} k - size 32
 * @return {bool}
 * @return {buffer} result - size 64
 */
ecdsa_sign_without_hash: function(m,privkey,k,) { ecdsa_sign_without_hash: HaclWasm.P256.ecdsa_sign_without_hash.apply(null, arguments) },


/**
 * @param {buffer} m - size mlen
 * @param {buffer} pubkey - size 64
 * @param {buffer} r - size 32
 * @param {buffer} s - size 32
 * @return {bool}
 */
ecdsa_verif_without_hash: function(m,pubkey,r,s,) { ecdsa_verif_without_hash: HaclWasm.P256.ecdsa_verif_without_hash.apply(null, arguments) },


/**
 * @param {buffer} m - size mlen
 * @param {buffer} privkey - size 32
 * @param {buffer} k - size 32
 * @return {bool}
 * @return {buffer} result - size 64
 */
ecdsa_sign_sha2: function(m,privkey,k,) { ecdsa_sign_sha2: HaclWasm.P256.ecdsa_sign_sha2.apply(null, arguments) },


/**
 * @param {buffer} m - size mlen
 * @param {buffer} pubkey - size 64
 * @param {buffer} r - size 32
 * @param {buffer} s - size 32
 * @return {bool}
 */
ecdsa_verif_sha2: function(m,pubkey,r,s,) { ecdsa_verif_sha2: HaclWasm.P256.ecdsa_verif_sha2.apply(null, arguments) },


/**
 * @param {buffer} pubKey - size 64
 * @return {bool}
 */
verify_q: function(pubKey,) { verify_q: HaclWasm.P256.verify_q.apply(null, arguments) },


/**
 * @param {buffer} b - size 65
 * @return {bool}
 * @return {buffer} result - size 64
 */
decompression_not_compressed_form: function(b,) { decompression_not_compressed_form: HaclWasm.P256.decompression_not_compressed_form.apply(null, arguments) },


/**
 * @param {buffer} b - size 33
 * @return {bool}
 * @return {buffer} result - size 64
 */
decompression_compressed_form: function(b,) { decompression_compressed_form: HaclWasm.P256.decompression_compressed_form.apply(null, arguments) },


/**
 * @param {buffer} b - size 64
 * @return {buffer} result - size 65
 */
compression_not_compressed_form: function(b,) { compression_not_compressed_form: HaclWasm.P256.compression_not_compressed_form.apply(null, arguments) },


/**
 * @param {buffer} b - size 64
 * @return {buffer} result - size 33
 */
compression_compressed_form: function(b,) { compression_compressed_form: HaclWasm.P256.compression_compressed_form.apply(null, arguments) },


/**
 * @param {buffer} scalar - size 32
 * @return {bool}
 * @return {buffer} result - size 64
 */
dh_initiator: function(scalar,) { dh_initiator: HaclWasm.P256.dh_initiator.apply(null, arguments) },


/**
 * @param {buffer} pubKey - size 64
 * @param {buffer} scalar - size 32
 * @return {bool}
 * @return {buffer} result - size 64
 */
dh_responder: function(pubKey,scalar,) { dh_responder: HaclWasm.P256.dh_responder.apply(null, arguments) },


/**
 * @param {buffer} pubKey - size 32
 * @return {bool}
 */
is_more_than_zero_less_than_order: function(pubKey,) { is_more_than_zero_less_than_order: HaclWasm.P256.is_more_than_zero_less_than_order.apply(null, arguments) },
}
module.exports.P256 = P256