chore: export is_on_curve()

This commit is contained in:
Trent Nelson
2021-04-27 02:33:10 -06:00
committed by mergify[bot]
parent b17d5eeaee
commit aee30e304d
2 changed files with 21 additions and 0 deletions

View File

@@ -150,6 +150,13 @@ export class PublicKey {
}
throw new Error(`Unable to find a viable program address nonce`);
}
/**
* Check that a pubkey is on the ed25519 curve.
*/
static isOnCurve(pubkey: Uint8Array): boolean {
return is_on_curve(pubkey) == 1;
}
}
// @ts-ignore