sodium-javascript/crypto_shorthash.js

18 lines
573 B
JavaScript
Raw Permalink Normal View History

2017-06-12 09:01:21 +00:00
var siphash = require('siphash24')
2017-06-12 08:05:49 +00:00
exports.crypto_shorthash_PRIMITIVE = 'siphash24'
2017-06-12 09:01:21 +00:00
exports.crypto_shorthash_BYTES = siphash.BYTES
exports.crypto_shorthash_KEYBYTES = siphash.KEYBYTES
exports.crypto_shorthash_WASM_SUPPORTED = siphash.WASM_SUPPORTED
exports.crypto_shorthash_WASM_LOADED = siphash.WASM_LOADED
exports.crypto_shorthash_ready = siphash.ready
2017-06-12 08:05:49 +00:00
exports.crypto_shorthash = shorthash
2017-06-12 09:01:21 +00:00
siphash.ready(function () {
exports.crypto_shorthash_WASM_LOADED = siphash.WASM_LOADED
2017-06-12 08:05:49 +00:00
})
function shorthash (out, data, key, noAssert) {
2017-06-12 09:01:21 +00:00
siphash(data, key, out, noAssert)
2017-06-12 08:05:49 +00:00
}