cardano-crypto.js
Advanced tools
Comparing version 2.0.2 to 3.0.0
14
index.js
@@ -144,3 +144,3 @@ var Module = require('./lib.js') | ||
return cborEncodeBuffer(blake2b256(cborEncodeBuffer(ent))) | ||
return cborEncodeBuffer(blake2b(cborEncodeBuffer(ent), 32)) | ||
} | ||
@@ -228,3 +228,3 @@ | ||
function blake2b256(input) { | ||
function blake2b(input, outputLen) { | ||
validateBuffer(input) | ||
@@ -235,8 +235,8 @@ | ||
var inputArr = new Uint8Array(Module.HEAPU8.buffer, inputArrPtr, inputLen) | ||
var outputArrPtr = Module._malloc(32) | ||
var outputArr = new Uint8Array(Module.HEAPU8.buffer, outputArrPtr, 32) | ||
var outputArrPtr = Module._malloc(outputLen) | ||
var outputArr = new Uint8Array(Module.HEAPU8.buffer, outputArrPtr, outputLen) | ||
inputArr.set(input) | ||
Module._blake2b256(inputArrPtr, inputLen, outputArrPtr) | ||
Module._blake2b_emscripten(inputArrPtr, inputLen, outputArrPtr, outputLen) | ||
@@ -277,3 +277,3 @@ Module._free(inputArrPtr) | ||
var transformedPassword = blake2b256(Buffer.from(password, 'utf-8')) | ||
var transformedPassword = blake2b(Buffer.from(password, 'utf-8'), 32) | ||
var transformedPasswordLen = transformedPassword.length | ||
@@ -399,5 +399,5 @@ var transformedPasswordArrPtr = Module._malloc(transformedPasswordLen) | ||
chacha20poly1305Decrypt, | ||
blake2b256, | ||
blake2b, | ||
walletSecretFromMnemonic, | ||
cardanoMemoryCombine, | ||
} |
{ | ||
"name": "cardano-crypto.js", | ||
"version": "2.0.2", | ||
"version": "3.0.0", | ||
"description": "input-output-hk/cardano-crypto compiled to pure javascript using Emscripten", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -105,9 +105,9 @@ var test = require('tape') | ||
test('blake2b256', function(t){ | ||
test('blake2b', function(t){ | ||
t.plan(1) | ||
t.equals( | ||
lib.blake2b256(sampleMessage).toString('hex'), | ||
lib.blake2b(sampleMessage, 32).toString('hex'), | ||
'a21cf4b3604cf4b2bc53e6f88f6a4d75ef5ff4ab415f3e99aea6b61c8249c4d0', | ||
'should properly compute blake2b256 hash' | ||
'should properly compute blake2b hash' | ||
) | ||
@@ -114,0 +114,0 @@ }) |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
241812