Comparing version 0.9.1 to 0.9.2
@@ -0,1 +1,10 @@ | ||
## [0.9.2](https://github.com/AraBlocks/ara-crypto/compare/0.9.1...0.9.2) (2021-04-02) | ||
### Bug Fixes | ||
* unbox nonce and key length ([033d294](https://github.com/AraBlocks/ara-crypto/commit/033d2944e50e2d9e10d6157bd851da5812c946b7)) | ||
## [0.9.1](https://github.com/AraBlocks/ara-crypto/compare/0.9.0...0.9.1) (2021-04-02) | ||
@@ -2,0 +11,0 @@ |
{ | ||
"name": "ara-crypto", | ||
"version": "0.9.1", | ||
"version": "0.9.2", | ||
"description": "Cryptographic functions used in Ara modules", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -9,2 +9,3 @@ const increment = require('increment-buffer') | ||
crypto_secretbox_MACBYTES, | ||
crypto_secretbox_NONCEBYTES, | ||
@@ -50,3 +51,4 @@ crypto_secretbox_open_easy, | ||
} | ||
key = key.slice(0, crypto_secretbox_KEYBYTES) | ||
const nonces = [ copy(nonce), increment(copy(nonce)) ] | ||
@@ -58,3 +60,3 @@ const header = Buffer.allocUnsafe(2 + crypto_secretbox_MACBYTES) | ||
buffer.slice(0, 2 + (2 * crypto_secretbox_MACBYTES)), | ||
nonces[0], | ||
nonces[0].slice(0, crypto_secretbox_NONCEBYTES), | ||
key | ||
@@ -81,3 +83,3 @@ ) | ||
combined, | ||
nonces[1], | ||
nonces[1].slice(0, crypto_secretbox_NONCEBYTES), | ||
key | ||
@@ -84,0 +86,0 @@ ) |
164405
3795