Skip to content

Add OSSL_FN_CTX size helpers #2011

Description

@levitte

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

Status
Waiting Review

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions