Ref: openssl/openssl#31479 (comment)
Goal
Introduce a byte-oriented sizing model for OSSL_FN_CTX and add operation-specific OSSL_FN_{operation}_ctx_size() helpers that derive the required context allocation from the actual OSSL_FN operands, then use those helpers in the existing BN_ wrappers and tests.
Scope
- Add general
OSSL_FN_CTX byte-size calculation API.
- Decide and implement the
OSSL_FN_CTX_new() / OSSL_FN_CTX_new_size() migration path.
- Add ctx-size helpers next to the corresponding
OSSL_FN_* declarations in include/crypto/fn.h.
- Move existing ad-hoc limb calculations from
crypto/bn/*.c into crypto/fn/*.c helpers.
- Make compound helpers call each other where possible.
- Update tests to exercise the new sizing helpers and allocation API.
Ref: openssl/openssl#31479 (comment)
Goal
Introduce a byte-oriented sizing model for
OSSL_FN_CTXand add operation-specificOSSL_FN_{operation}_ctx_size()helpers that derive the required context allocation from the actualOSSL_FNoperands, then use those helpers in the existingBN_wrappers and tests.Scope
OSSL_FN_CTXbyte-size calculation API.OSSL_FN_CTX_new()/OSSL_FN_CTX_new_size()migration path.OSSL_FN_*declarations ininclude/crypto/fn.h.crypto/bn/*.cintocrypto/fn/*.chelpers.