[openssl/openssl] 12af10: OSSL_FN: unwrap BN_CTX's wrapping of OSSL_FN_CTX
"'Richard Levitte' via openssl-commits" <[email protected]> Fri, 10 Jul 2026 06:24:07 -0700
| Newsgroups | gmane.comp.encryption.openssl.cvs |
|---|---|
| Message-ID | <openssl/openssl/push/refs/heads/feature/ossl_fn+ctx-size/[email protected]> |
Branch: refs/heads/feature/ossl_fn+ctx-size
Home: https://github.com/openssl/openssl
Commit: 12af10561c3129babfeaf67625d416c1f179c508
https://github.com/openssl/openssl/commit/12af10561c3129babfeaf67625d416c1f179c508
Author: Richard Levitte <[email protected]>
Date: 2026-07-10 (Fri, 10 Jul 2026)
Changed paths:
M crypto/bn/bn_ctx.c
M include/crypto/bn.h
M test/bn_internal_test.c
Log Message:
-----------
OSSL_FN: unwrap BN_CTX's wrapping of OSSL_FN_CTX
The BN_CTX -> OSSL_FN_CTX acquisition machinery
(bn_ctx_acquire_ossl_fn_ctx / bn_ctx_release_ossl_fn_ctx and the
fn_ctx field on struct bignum_ctx) existed only to serve the BN_*
arithmetic wrappers that delegated to OSSL_FN. Those wrappers were
removed in previous commits, leaving the machinery orphaned except
for the self-test that exercised it; OSSL_FN consumers obtain their
OSSL_FN_CTX directly via OSSL_FN_CTX_new() / OSSL_FN_CTX_secure_new().
Remove the wrapping machinery and its dedicated test
(test_bn_ctx_fn_ctx) by reverting:
e3213b0c03 ("Add OSSL_FN_CTX integration with BN_CTX")
Assisted-by: Pi:z-ai/glm-5.2
Signed-off-by: Richard Levitte <[email protected]>
Commit: abcfddc711660e89b597c53a8925edf15f8633ab
https://github.com/openssl/openssl/commit/abcfddc711660e89b597c53a8925edf15f8633ab
Author: Richard Levitte <[email protected]>
Date: 2026-07-10 (Fri, 10 Jul 2026)
Changed paths:
M crypto/bn/bn_lib.c
M crypto/bn/bn_local.h
M include/crypto/bn.h
Log Message:
-----------
OSSL_FN: Expose BN OSSL_FN acquire helpers
Move the BIGNUM to OSSL_FN acquire/release helpers out of
bn_local.h and declare them in the internal BN header. This makes
them available to call sites that need to operate temporarily on the
fixed-width representation.
Assisted-by: Pi:openai/gpt-5.5
Signed-off-by: Richard Levitte <[email protected]>
Commit: c8945bc9e03f3320e372b97a488857cb4a0457a3
https://github.com/openssl/openssl/commit/c8945bc9e03f3320e372b97a488857cb4a0457a3
Author: Richard Levitte <[email protected]>
Date: 2026-07-10 (Fri, 10 Jul 2026)
Changed paths:
M crypto/bn/bn_lib.c
M include/crypto/bn.h
Log Message:
-----------
OSSL_FN: Add read-only BIGNUM OSSL_FN accessor
Add bn_get_ossl_fn(), a read-only counterpart to bn_acquire_ossl_fn().
Unlike the latter, it neither acquires nor resizes the BIGNUM: the
BIGNUM stays usable with BN_ functions, no bn_release() is needed, and
the returned OSSL_FN keeps the BIGNUM's current allocated width. This
suits read-only operands at OSSL_FN call sites.
Assisted-by: Pi:openai/gpt-5.5
Signed-off-by: Richard Levitte <[email protected]>
Commit: fe859ea541a394d1437b88e9f030d24fe149f5a1
https://github.com/openssl/openssl/commit/fe859ea541a394d1437b88e9f030d24fe149f5a1
Author: Richard Levitte <[email protected]>
Date: 2026-07-10 (Fri, 10 Jul 2026)
Changed paths:
M test/build.info
A test/fntest.c
A test/recipes/11-test_fn.t
Log Message:
-----------
OSSL_FN: Add OSSL_FN stanza arithmetic test
Add fntest as a stanza-driven arithmetic test for the OSSL_FN
operations currently available in this branch. The test reuses the
existing BN input files and reports known but unsupported stanza types
as skipped.
Wire the new test program into the build and add a test_fn recipe for
sum, multiplication, square, and left-shift coverage.
Assisted-by: Pi:openai/gpt-5.5
Assisted-by: Pi:z-ai/glm-5.2
Signed-off-by: Richard Levitte <[email protected]>
Resolves: https://github.com/openssl/project/issues/2021
Commit: ed96903fcc3228c8394a195ac5ec4cd606a4b252
https://github.com/openssl/openssl/commit/ed96903fcc3228c8394a195ac5ec4cd606a4b252
Author: Richard Levitte <[email protected]>
Date: 2026-07-10 (Fri, 10 Jul 2026)
Changed paths:
M test/recipes/11-test_fn_api.t
Log Message:
-----------
OSSL_FN: Let test/recipes/11-test_fn_api.t run on Windows too
Windows was excluded from this test recipe. That was a mistake.
Commit: 7332566be3b430058f17531df15bec90896cebc0
https://github.com/openssl/openssl/commit/7332566be3b430058f17531df15bec90896cebc0
Author: Richard Levitte <[email protected]>
Date: 2026-07-10 (Fri, 10 Jul 2026)
Changed paths:
M crypto/bn/bn_ctx.c
M crypto/bn/bn_lib.c
M crypto/bn/bn_local.h
M include/crypto/bn.h
M test/bn_internal_test.c
M test/build.info
A test/fntest.c
A test/recipes/11-test_fn.t
M test/recipes/11-test_fn_api.t
Log Message:
-----------
Merge branches 'feature/ossl_fn+2020+unwrap-bn-ctx' and 'feature/ossl_fn+2021+fn-bntest' into feature/ossl_fn+2018+decouple-integration
Commit: d5b317444189a1eaa2ebcdb1e5eb42cee4276f54
https://github.com/openssl/openssl/commit/d5b317444189a1eaa2ebcdb1e5eb42cee4276f54
Author: Richard Levitte <[email protected]>
Date: 2026-07-10 (Fri, 10 Jul 2026)
Changed paths:
M crypto/fn/fn_ctx.c
M crypto/fn/fn_local.h
M crypto/fn/fn_mul.c
M crypto/fn/fn_sqr.c
M include/crypto/fn.h
M test/fn_internal_test.c
Log Message:
-----------
OSSL_FN: Size contexts in bytes
OSSL_FN_CTX callers currently describe the arena in frames, numbers
and limbs. That works for a single operation, but it makes higher
level sizing awkward because each caller has to keep redoing the same
conversion.
Add an overflow-checked OSSL_FN_CTX_size() helper that returns the
arena payload size, plus byte-sized constructors for normal and secure
contexts. The existing frame/number/limb constructors become wrappers
around it so current callers keep working while newer code can compose
byte sizes directly. The old internal ossl_fn_ctx_calculate_arena_size()
inline is replaced by the public, overflow-checked helper.
Add per-operation ctx-size helpers OSSL_FN_mul_ctx_size() and
OSSL_FN_sqr_ctx_size(), which fold in the aliasing and
destination-width considerations of OSSL_FN_mul() / OSSL_FN_sqr().
Assisted-by: Pi:openai/gpt-5.5
Assisted-by: Pi:z-ai/glm-5.2
Signed-off-by: Richard Levitte <[email protected]>
Commit: a088efbfe44cde02cbcab41b9895fee56a4d2bca
https://github.com/openssl/openssl/commit/a088efbfe44cde02cbcab41b9895fee56a4d2bca
Author: Richard Levitte <[email protected]>
Date: 2026-07-10 (Fri, 10 Jul 2026)
Changed paths:
M test/fntest.c
Log Message:
-----------
OSSL_FN: use ctx-size helpers in fntest
The mul and sqr tests in test/fntest.c sized their OSSL_FN_CTX arenas
by hand, passing fixed frame/number/limb counts to OSSL_FN_CTX_new().
Switch them to OSSL_FN_CTX_new_size() driven by OSSL_FN_mul_ctx_size()
/ OSSL_FN_sqr_ctx_size(), passing the actual result and operand
OSSL_FNs so the per-op helpers can account for aliasing and
destination width.
This gives the ctx-size helpers real callers in the tree and makes the
test sizing match what OSSL_FN_mul() / OSSL_FN_sqr() actually need
instead of the previous oversized estimates.
Assisted-by: Pi:z-ai/glm-5.2
Signed-off-by: Richard Levitte <[email protected]>
Assisted-by: Pi:openai/gpt-5.5
Compare: https://github.com/openssl/openssl/compare/12af10561c31%5E...a088efbfe44c
To unsubscribe from these emails, change your notification settings at https://github.com/openssl/openssl/settings/notifications
--
You received this message because you are subscribed to the Google Groups "openssl-commits" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/a/openssl.org/d/msgid/openssl-commits/openssl/openssl/push/refs/heads/feature/ossl_fn%2Bctx-size/000000-a088ef%40github.com.