Skip to content

Conversation

@mratsim
Copy link
Owner

@mratsim mratsim commented Jan 3, 2024

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, as setInf 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

@mratsim
Copy link
Owner Author

mratsim commented Jun 13, 2024

If you use the KZG parallel implementation of Constantine, I have changed the API in #394.

The threadpool is now directly stored in the KZG context.

See https://github.com/mratsim/constantine/pull/394/files#diff-2c8630f256e9d494d19bbb20fae5cd7a6ced97a9800d5a192c1979bde72e5494R487

I can update the branch whenever.

No impact on the serial KZG.

@sauliusgrigaitis
Copy link

Thanks, if you want to work on rust-kzg update then check https://github.com/ArtiomTr/rust-kzg/tree/Integrate_sppark_msm . This is going to be merged soon. It also contains the updated performance graphs. Seems constantine peformance penalty is gone!

@mratsim mratsim force-pushed the constantine-public-sys branch from 9f85b83 to 275537c Compare January 8, 2025 20:22
@mratsim
Copy link
Owner Author

mratsim commented Jan 8, 2025

Happy New Year,

I've updated the bindings to latest Constantine.

@mratsim mratsim force-pushed the constantine-public-sys branch from 275537c to 3ed6eea Compare January 8, 2025 22:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants