mirror of
https://github.com/fluencelabs/js-libp2p-crypto
synced 2025-03-15 19:50:58 +00:00
fix: workaround missing sha512 support in forge.hmac
This commit is contained in:
parent
3037541d3c
commit
87a30e2e9b
@ -21,7 +21,8 @@ const cipherMap = {
|
|||||||
const hashMap = {
|
const hashMap = {
|
||||||
SHA1: 'sha1',
|
SHA1: 'sha1',
|
||||||
SHA256: 'sha256',
|
SHA256: 'sha256',
|
||||||
SHA512: 'sha512'
|
// workaround for https://github.com/digitalbazaar/forge/issues/401
|
||||||
|
SHA512: forge.md.sha512.create()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Generates a set of keys for each party by stretching the shared key.
|
// Generates a set of keys for each party by stretching the shared key.
|
||||||
|
@ -9,8 +9,7 @@ const fixtures = require('./fixtures/go-stretch-key')
|
|||||||
describe('keyStretcher', () => {
|
describe('keyStretcher', () => {
|
||||||
describe('generate', () => {
|
describe('generate', () => {
|
||||||
const ciphers = ['AES-128', 'AES-256', 'Blowfish']
|
const ciphers = ['AES-128', 'AES-256', 'Blowfish']
|
||||||
const hashes = ['SHA1', 'SHA256']
|
const hashes = ['SHA1', 'SHA256', 'SHA512']
|
||||||
// add 'SHA512' when https://github.com/digitalbazaar/forge/issues/401 is resolved
|
|
||||||
const res = crypto.generateEphemeralKeyPair('P-256')
|
const res = crypto.generateEphemeralKeyPair('P-256')
|
||||||
const secret = res.genSharedKey(res.key)
|
const secret = res.genSharedKey(res.key)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user