From d285fcce0609cb1312351416b100b26951d51ba5 Mon Sep 17 00:00:00 2001 From: Paul Miller Date: Mon, 21 Aug 2023 15:52:21 +0000 Subject: [PATCH] modular: Document FpPow --- src/abstract/modular.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/abstract/modular.ts b/src/abstract/modular.ts index 3592cff..4265873 100644 --- a/src/abstract/modular.ts +++ b/src/abstract/modular.ts @@ -265,6 +265,11 @@ export function validateField(field: IField) { } // 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(f: IField, num: T, power: bigint): T { // Should have same speed as pow for bigints // TODO: benchmark!