Fix nip44 vectors (#308)

* Fix nip44 vectors

* Update vectors

* Update vectors
This commit is contained in:
Paul Miller
2023-09-30 23:46:45 +02:00
committed by GitHub
parent eb0a9093f2
commit 5e85bbc2ed
3 changed files with 35 additions and 39 deletions

View File

@@ -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()
}
})