[End-user workaround] Constantine-rust: public fields and Default fields #331
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Requested by https://github.com/sifraitech/rust-kzg
Due to the orphan rule preventing building traits on top of external libraries, the Sifraitech team needs the fields to be public.
Unfortunately this conflicts with security best practices and isolation concerns, especially given that Constantine may handle sensitive secrets that must be protected in a best effort manner. Keeping fields private is a good way to avoid accidentally spilling data in a debug log for example.
This exposes the fields in a branch while keeping the library pristine.
This also adds a
Default
trait implementation for convenience. For elliptic curves using it as-is MAY result in undefined behavior for Jacobian or Projective points, assetInf
is the proper initialization.This commit Ensure the projective point at infinity is not all zeros, but (0, 1, 0) fixed an issue with all zero initialization.
Though I'm not sure how to automate it with
bindgen
.cc @Armantidas @sauliusgrigaitis