secretbox.nonceLength = crypto_secretbox_NONCEBYTES;\r
secretbox.overheadLength = crypto_secretbox_BOXZEROBYTES;\r
\r
- scalarMult = function(n, p) {\r
- checkArrayTypes(n, p);\r
- if (n.length !== crypto_scalarmult_SCALARBYTES) throw new Error('bad n size');\r
- if (p.length !== crypto_scalarmult_BYTES) throw new Error('bad p size');\r
- var q = new Uint8Array(crypto_scalarmult_BYTES);\r
- crypto_scalarmult(q, n, p);\r
- return q;\r
- };\r
-\r
- scalarMult.base = function(n) {\r
- checkArrayTypes(n);\r
- if (n.length !== crypto_scalarmult_SCALARBYTES) throw new Error('bad n size');\r
- var q = new Uint8Array(crypto_scalarmult_BYTES);\r
- crypto_scalarmult_base(q, n);\r
- return q;\r
- };\r
-\r
- scalarMult.scalarLength = crypto_scalarmult_SCALARBYTES;\r
- scalarMult.groupElementLength = crypto_scalarmult_BYTES;\r
-\r
sign = function(msg, secretKey) {\r
checkArrayTypes(msg, secretKey);\r
if (secretKey.length !== crypto_sign_SECRETKEYBYTES)\r