wg-lua/tests/generatePublicKey.luau

10 lines
358 B
Lua
Raw Permalink Normal View History

2024-03-27 12:19:16 +00:00
local wg = require("../out/").wireguard
local PRIVATE_KEY = "iIWrphmeEnCLZFjdN17RQfEq8ND1MX+qAdIpRJdRhEA="
local PUBLIC_KEY = "lYnVoKy9rzIapS0zPoLHskf4B+L3FouFXWwddKhRa3s="
2024-03-27 12:19:16 +00:00
local publicKey = wg:generatePublicKey(PRIVATE_KEY)
assert(#publicKey == 44, "expected public key to be 44 bytes")
assert(publicKey == PUBLIC_KEY, "expected the correct public key")