]> git.ipfire.org Git - thirdparty/openssl.git/commit
OSSL_FN: Refactor OSSL_FN_add() and OSSL_FN_sub() for truncation feature/ossl_fn
authorRichard Levitte <levitte@openssl.org>
Wed, 3 Dec 2025 20:21:37 +0000 (21:21 +0100)
committerRichard Levitte <levitte@openssl.org>
Wed, 17 Dec 2025 12:16:00 +0000 (13:16 +0100)
commit9043e50a396fab5b58435a1fb77f84ce9a8432b1
tree13676f92461654fdf6a9c3aad99f26f5784c906e
parent2f6e92db2e9c71f9943f823b3d038f0956b67fb5
OSSL_FN: Refactor OSSL_FN_add() and OSSL_FN_sub() for truncation

OSSL_FN_mul() set a path that wasn't considered for OSSL_FN_add() and
OSSL_FN_sub(); a truncated result if the result OSSL_FN isn't large
enough to contain the full result.

This is done to keep the OSSL_FN API consistent, with a (tentative)
bonus, that the function calls become more constant time accross
repeated calls with the same size for operands and result.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/29309)
crypto/fn/fn_addsub.c
test/fn_api_test.c