Skip to main content
Version: 11.x

Function: getPublicKey()

getPublicKey(secretKey): Uint8Array

Defined in: s2morrow/keys.ts:502

Public key h = g / f mod q of a validated secret key (NIST format).

Parameters​

secretKey​

string | Uint8Array<ArrayBufferLike>

the NIST secret key (1281 bytes), or its hex string

Returns​

Uint8Array

the NIST public key (897 bytes)

Throws​

when the secret key is invalid

Example​

const { secretKey, publicKey } = falcon512.generateKeyPair();
const result = falcon512.getPublicKey(secretKey);
// result = Uint8Array(897) [9, …] (the same bytes as publicKey)