rename encrypt/decrypt to wrap/unwrap in *Wrap
ci/woodpecker/manual/test Pipeline was successful

This commit is contained in:
2024-09-09 22:49:42 +02:00
parent c49f3b84bf
commit 9de49c228d
8 changed files with 42 additions and 42 deletions
+5 -5
View File
@@ -12,13 +12,13 @@ beforeAll(async () => {
})
test('base case', async () => {
const box = await SecretWrap.encrypt(message, k1)
const unboxed = await box.decrypt(k1)
const box = await SecretWrap.wrap(message, k1)
const unboxed = await box.unwrap(k1)
expect(unboxed).toEqual(message)
})
test("Different key can't decrypt", async () => {
const box = await SecretWrap.encrypt(message, k1)
const unboxed = await box.decrypt(k2)
const box = await SecretWrap.wrap(message, k1)
const unboxed = await box.unwrap(k2)
expect(unboxed).toBeNull()
})
@@ -28,7 +28,7 @@ test('Key generation', async () => {
})
test('serialization', async () => {
const box = await SecretWrap.encrypt(message, k1)
const box = await SecretWrap.wrap(message, k1)
const ser = box.toString()
const de = SecretWrap.fromString(ser)