mirror of
https://github.com/fluencelabs/js-libp2p-crypto
synced 2025-06-30 04:11:50 +00:00
fix: some issues found when using in libp2p-secio
This commit is contained in:
committed by
dignifiedquire
parent
1f4823e202
commit
18810aca86
@ -112,4 +112,26 @@ describe('RSA', () => {
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
it('sign and verify', () => {
|
||||
const data = new Buffer('hello world')
|
||||
const sig = key.sign(data)
|
||||
|
||||
expect(
|
||||
key.public.verify(data, sig)
|
||||
).to.be.eql(
|
||||
true
|
||||
)
|
||||
})
|
||||
|
||||
it('does fails to verify for different data', () => {
|
||||
const data = new Buffer('hello world')
|
||||
const sig = key.sign(data)
|
||||
|
||||
expect(
|
||||
key.public.verify(new Buffer('hello'), sig)
|
||||
).to.be.eql(
|
||||
false
|
||||
)
|
||||
})
|
||||
})
|
||||
|
Reference in New Issue
Block a user