e = g^x mod p as a minimal big-endian magnitude.group14Public
fn
ubyte[] group14Public(BigInt x, Random rng = new SecureRandom())Computes the group14 public value for a private exponent.
The exponentiation blinds the private exponent with a fresh random multiple of p - 1 before the variable-time modular exponentiation, exactly as the DH agreement does: g^(x + r(p-1)) = g^x for prime p, while every call evaluates an unpredictable exponent so its timing cannot be averaged into the secret. The underlying powmod remains variable-time; this closes the unblinded public-generation path but is not a constant-time qualification.
Parameters
x | Private exponent in [2, p - 2]. |
rng | Cryptographic random source for the blinding factor. |