-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1719adf
commit 0de2847
Showing
6 changed files
with
215 additions
and
48 deletions.
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
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
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
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
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { | ||
genPreshared, genPresharedAsync, | ||
genPrivate, genPrivateAsync, | ||
genPublic, genPublicAsync, | ||
keygen, keygenAsync | ||
} from "./keygen"; | ||
|
||
const keysToGen = Array(8 ** 3).fill(null); | ||
|
||
// Async | ||
describe("Wireguard generate keys Async", function() { | ||
it("Preshared", async () => genPresharedAsync()); | ||
it("Private", async () => genPrivateAsync()); | ||
it("Public", async () => genPublicAsync(await genPrivateAsync())); | ||
it("Generate keys without preshared", async () => keygenAsync()); | ||
it("Generate keys with preshared", async () => keygenAsync(true)); | ||
it(`Random keys ${keysToGen.length} with preshared`, () => Promise.all(keysToGen.map(async () => keygenAsync(true)))); | ||
it(`Random keys ${keysToGen.length} without preshared`, () => Promise.all(keysToGen.map(async () => keygenAsync()))); | ||
}); | ||
|
||
describe("Wireguard generate keys Sync", function() { | ||
it("Preshared", () => genPreshared()); | ||
it("Private", () => genPrivate()); | ||
it("Public", () => genPublic(genPrivate())); | ||
it("Generate keys without preshared", () => keygen()); | ||
it("Generate keys with preshared", () => keygen(true)); | ||
it(`Random keys ${keysToGen.length} with preshared`, () => keysToGen.map(() => keygen(true))); | ||
it(`Random keys ${keysToGen.length} without preshared`, () => keysToGen.map(() => keygen())); | ||
}); |
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