aboutsummaryrefslogtreecommitdiff
path: root/src/codegen/spirv
diff options
context:
space:
mode:
authorFrank Denis <124872+jedisct1@users.noreply.github.com>2023-10-21 11:09:43 +0200
committerGitHub <noreply@github.com>2023-10-21 02:09:43 -0700
commita5c79c79983739630d7269f8583525d83ba9677b (patch)
treea1e29fca84b608a66f96fce1feb7d764e308a43a /src/codegen/spirv
parent54a4f24ea7c76297e97683501aef607b2a27cd16 (diff)
downloadzig-a5c79c79983739630d7269f8583525d83ba9677b.tar.gz
zig-a5c79c79983739630d7269f8583525d83ba9677b.zip
crypto.ff: faster exponentiation with short/public exponents (#17617)
RSA exponents are typically 3 or 65537, and public. For those, we don't need to use conditional moves on the exponent, and precomputing a lookup table is not worth it. So, save a few cpu cycles and some memory for that common case. For safety, make `powWithEncodedExponent()` constant-time by default, and introduce a `powWithEncodedPublicExponent()` function for exponents that are assumed to be public. With `powWithEncodedPublicExponent()`, short (<= 36 bits) exponents will take the fast path.
Diffstat (limited to 'src/codegen/spirv')
0 files changed, 0 insertions, 0 deletions