mirror of
https://github.com/fluencelabs/js-libp2p-crypto
synced 2025-07-31 05:22:11 +00:00
fix: dont add the redundant public key when marshalling
This commit is contained in:
@@ -9,6 +9,7 @@ chai.use(dirtyChai)
|
||||
|
||||
const crypto = require('../../src')
|
||||
const ed25519 = crypto.keys.supportedKeys.ed25519
|
||||
const { privateKeyLength } = require('../../src/keys/ed25519')
|
||||
const fixtures = require('../fixtures/go-key-ed25519')
|
||||
|
||||
const testGarbage = require('../helpers/test-garbage-error-handling')
|
||||
@@ -154,5 +155,10 @@ describe('ed25519', function () {
|
||||
const sig = await key.sign(fixtures.redundantPubKey.data)
|
||||
expect(sig).to.eql(fixtures.redundantPubKey.signature)
|
||||
})
|
||||
|
||||
it('doesnt include the redundant public key when marshalling', async () => {
|
||||
const key = await crypto.keys.unmarshalPrivateKey(fixtures.redundantPubKey.privateKey)
|
||||
expect(key.marshal()).to.have.length(privateKeyLength)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
Reference in New Issue
Block a user