mirror of
https://github.com/nbd-wtf/nostr-tools.git
synced 2025-12-13 02:18:51 +00:00
Fix nip44 vectors (#308)
* Fix nip44 vectors * Update vectors * Update vectors
This commit is contained in:
@@ -30,8 +30,8 @@ test('NIP44: invalid', async () => {
|
||||
for (const v of vectors.invalid) {
|
||||
expect(() => {
|
||||
const key = utils.v2.getConversationKey(v.sec1, v.pub2)
|
||||
const ciphertext = decrypt(key, v.plaintext)
|
||||
}).toThrowError()
|
||||
const ciphertext = decrypt(key, v.ciphertext)
|
||||
}).toThrowError(v.note)
|
||||
}
|
||||
})
|
||||
|
||||
@@ -39,7 +39,7 @@ test('NIP44: invalid_conversation_key', async () => {
|
||||
for (const v of vectors.invalid_conversation_key) {
|
||||
expect(() => {
|
||||
const key = utils.v2.getConversationKey(v.sec1, v.pub2)
|
||||
const ciphertext = encrypt(key, v.plaintext)
|
||||
const ciphertext = encrypt(key, 'a')
|
||||
}).toThrowError()
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user