add endian check: all other modules require members of this set
This commit is contained in:
parent
aa0305154f
commit
759cec5b5a
@ -1,5 +1,7 @@
|
|||||||
var blake2b = require('blake2b')
|
var blake2b = require('blake2b')
|
||||||
|
|
||||||
|
if (new Uint16Array([1])[0] !== 1) throw new Error('Big endian architecture is not supported.')
|
||||||
|
|
||||||
module.exports.crypto_generichash_PRIMITIVE = 'blake2b'
|
module.exports.crypto_generichash_PRIMITIVE = 'blake2b'
|
||||||
module.exports.crypto_generichash_BYTES_MIN = blake2b.BYTES_MIN
|
module.exports.crypto_generichash_BYTES_MIN = blake2b.BYTES_MIN
|
||||||
module.exports.crypto_generichash_BYTES_MAX = blake2b.BYTES_MAX
|
module.exports.crypto_generichash_BYTES_MAX = blake2b.BYTES_MAX
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
var siphash = require('siphash24')
|
var siphash = require('siphash24')
|
||||||
|
|
||||||
|
if (new Uint16Array([1])[0] !== 1) throw new Error('Big endian architecture is not supported.')
|
||||||
|
|
||||||
exports.crypto_shorthash_PRIMITIVE = 'siphash24'
|
exports.crypto_shorthash_PRIMITIVE = 'siphash24'
|
||||||
exports.crypto_shorthash_BYTES = siphash.BYTES
|
exports.crypto_shorthash_BYTES = siphash.BYTES
|
||||||
exports.crypto_shorthash_KEYBYTES = siphash.KEYBYTES
|
exports.crypto_shorthash_KEYBYTES = siphash.KEYBYTES
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
var xsalsa20 = require('xsalsa20')
|
var xsalsa20 = require('xsalsa20')
|
||||||
|
|
||||||
|
if (new Uint16Array([1])[0] !== 1) throw new Error('Big endian architecture is not supported.')
|
||||||
|
|
||||||
exports.crypto_stream_KEYBYTES = 32
|
exports.crypto_stream_KEYBYTES = 32
|
||||||
exports.crypto_stream_NONCEBYTES = 24
|
exports.crypto_stream_NONCEBYTES = 24
|
||||||
exports.crypto_stream_PRIMITIVE = 'xsalsa20'
|
exports.crypto_stream_PRIMITIVE = 'xsalsa20'
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
const assert = require('nanoassert')
|
const assert = require('nanoassert')
|
||||||
const Chacha20 = require('chacha20-universal')
|
const Chacha20 = require('chacha20-universal')
|
||||||
|
|
||||||
|
if (new Uint16Array([1])[0] !== 1) throw new Error('Big endian architecture is not supported.')
|
||||||
|
|
||||||
exports.crypto_stream_chacha20_KEYBYTES = 32
|
exports.crypto_stream_chacha20_KEYBYTES = 32
|
||||||
exports.crypto_stream_chacha20_NONCEBYTES = 8
|
exports.crypto_stream_chacha20_NONCEBYTES = 8
|
||||||
exports.crypto_stream_chacha20_MESSAGEBYTES_MAX = Number.MAX_SAFE_INTEGER
|
exports.crypto_stream_chacha20_MESSAGEBYTES_MAX = Number.MAX_SAFE_INTEGER
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
if (new Uint16Array([1])[0] !== 1) throw new Error('Big endian architecture is not supported.')
|
||||||
|
|
||||||
var gf = function(init) {
|
var gf = function(init) {
|
||||||
var i, r = new Float64Array(16);
|
var i, r = new Float64Array(16);
|
||||||
if (init) for (i = 0; i < init.length; i++) r[i] = init[i];
|
if (init) for (i = 0; i < init.length; i++) r[i] = init[i];
|
||||||
|
@ -3,6 +3,8 @@
|
|||||||
* https://github.com/floodyberry/poly1305-donna
|
* https://github.com/floodyberry/poly1305-donna
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
if (new Uint16Array([1])[0] !== 1) throw new Error('Big endian architecture is not supported.')
|
||||||
|
|
||||||
var poly1305 = function(key) {
|
var poly1305 = function(key) {
|
||||||
this.buffer = new Uint8Array(16);
|
this.buffer = new Uint8Array(16);
|
||||||
this.r = new Uint16Array(10);
|
this.r = new Uint16Array(10);
|
||||||
|
Loading…
Reference in New Issue
Block a user