Skip to content

Commit

Permalink
added test for conformance with go codebase
Browse files Browse the repository at this point in the history
  • Loading branch information
CluEleSsUK committed Sep 18, 2023
1 parent ee79868 commit 33a1f28
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion test/crypto/rfc-scheme.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
import {mainnetClient, timelockDecrypt} from "../../src"

describe("rfc compliant scheme", () => {
it("should pass test vectors from go codebase", () => {
it("should pass test vectors from go codebase", async () => {
const ciphertext = "-----BEGIN AGE ENCRYPTED FILE-----\n" +
"YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IHRsb2NrIDc0NjUxMSA1MmRiOWJhNzBl\n" +
"MGNjMGY2ZWFmNzgwM2RkMDc0NDdhMWY1NDc3NzM1ZmQzZjY2MTc5MmJhOTQ2MDBj\n" +
"ODRlOTcxCmtEWkJHdnVveWVDeGI5MVBYVWgvY2pOWUdrcElRQU95dFhvUk9WbUNh\n" +
"dkVaeUN3OUVMR1ZBWE4zcTZKMlBrYmkKQURyQWVNdWJuMyswODJOVDNSR1ZCMDBv\n" +
"Nzg2MHhVMnl3N0pCbVV4eFY0UGJHZTREaWh2NWJrKzVibzVHRkRJUwpGaGFoS21R\n" +
"UVFrSDJyOEF6VkNHRXc5ekxPaGRQMktlbmxUSFhEREplc3JnCi0tLSBpMndTSkZI\n" +
"MnFveWFqSnhTOXhEazJSN2E2dWRKNWZReDBiUlRnZnFYak1zCnw2ccNps+whQe+p\n" +
"qVlJAYqlmEB4qFMRif9Z518uFEfAX5e5AyeQtVJcdfU3\n" +
"-----END AGE ENCRYPTED FILE-----\n"

const expectedPlaintext = "hello world\n"
const actualPlaintext = await timelockDecrypt(ciphertext, mainnetClient())

expect(actualPlaintext.toString()).toEqual(expectedPlaintext.toString())
})
})

0 comments on commit 33a1f28

Please sign in to comment.