modular: Document FpPow

This commit is contained in:
Paul Miller 2023-08-21 15:52:21 +00:00
parent ef667bb404
commit d285fcce06
No known key found for this signature in database
GPG Key ID: 697079DA6878B89B

@ -265,6 +265,11 @@ export function validateField<T>(field: IField<T>) {
} }
// Generic field functions // Generic field functions
/**
* Same as `pow` but for Fp: non-constant-time.
* Unsafe in some contexts: uses ladder, so can expose bigint bits.
*/
export function FpPow<T>(f: IField<T>, num: T, power: bigint): T { export function FpPow<T>(f: IField<T>, num: T, power: bigint): T {
// Should have same speed as pow for bigints // Should have same speed as pow for bigints
// TODO: benchmark! // TODO: benchmark!