-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added test for conformance with go codebase
- Loading branch information
1 parent
ee79868
commit 33a1f28
Showing
1 changed file
with
17 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()) | ||
}) | ||
}) |