-
Notifications
You must be signed in to change notification settings - Fork 130
fix: Ensure barretenberg provides headers that Noir needs #200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
0117211
fix: Add header files for c_binds that Noir needs
phated f3cc908
feat: Expose pedersen__commit in c_bind
phated b581489
fix!: Change new_pippenger points argument to uint8_t
phated 18b6a04
Merge branch 'master' into phated/c-bind-headers
kevaundray File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| #include <cstdint> | ||
| #include <cstddef> | ||
|
|
||
| #define WASM_EXPORT __attribute__((visibility("default"))) | ||
|
|
||
| extern "C" { | ||
|
|
||
| WASM_EXPORT void blake2s_to_field(uint8_t const* data, size_t length, uint8_t* r); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| #include <common/serialize.hpp> | ||
| #include <common/timer.hpp> | ||
| #include <common/mem.hpp> | ||
| #include <common/streams.hpp> | ||
| #define WASM_EXPORT __attribute__((visibility("default"))) | ||
|
|
||
| extern "C" { | ||
|
|
||
| WASM_EXPORT void pedersen__init(); | ||
|
|
||
| WASM_EXPORT void pedersen__compress_fields(uint8_t const* left, uint8_t const* right, uint8_t* result); | ||
|
|
||
| WASM_EXPORT void pedersen__compress(uint8_t const* inputs_buffer, uint8_t* output); | ||
|
|
||
| WASM_EXPORT void pedersen__compress_with_hash_index(uint8_t const* inputs_buffer, uint8_t* output, uint32_t hash_index); | ||
|
|
||
| WASM_EXPORT void pedersen__commit(uint8_t const* inputs_buffer, uint8_t* output); | ||
|
|
||
| WASM_EXPORT void pedersen__buffer_to_field(uint8_t const* data, size_t length, uint8_t* r); | ||
|
|
||
| /** | ||
| * Given a buffer containing 32 byte pedersen leaves, return a new buffer containing the leaves and all pairs of | ||
| * nodes that define a merkle tree. | ||
| * e.g. | ||
| * input: [1][2][3][4] | ||
| * output: [1][2][3][4][compress(1,2)][compress(3,4)][compress(5,6)] | ||
| */ | ||
| WASM_EXPORT uint8_t* pedersen__hash_to_tree(uint8_t const* data); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| #include <ecc/curves/grumpkin/grumpkin.hpp> | ||
|
|
||
| #define WASM_EXPORT __attribute__((visibility("default"))) | ||
|
|
||
| extern "C" { | ||
|
|
||
| WASM_EXPORT void compute_public_key(uint8_t const* private_key, uint8_t* public_key_buf); | ||
| WASM_EXPORT void negate_public_key(uint8_t const* public_key_buffer, uint8_t* output); | ||
|
|
||
| WASM_EXPORT void construct_signature( | ||
| uint8_t const* message, size_t msg_len, uint8_t const* private_key, uint8_t* s, uint8_t* e); | ||
|
|
||
| WASM_EXPORT bool verify_signature( | ||
| uint8_t const* message, size_t msg_len, uint8_t const* pub_key, uint8_t const* sig_s, uint8_t const* sig_e); | ||
|
|
||
| WASM_EXPORT void multisig_create_multisig_public_key(uint8_t const* private_key, uint8_t* multisig_pubkey_buf); | ||
|
|
||
| WASM_EXPORT bool multisig_validate_and_combine_signer_pubkeys(uint8_t const* signer_pubkey_buf, | ||
| uint8_t* combined_key_buf); | ||
|
|
||
| WASM_EXPORT void multisig_construct_signature_round_1(uint8_t* round_one_public_output_buf, | ||
| uint8_t* round_one_private_output_buf); | ||
|
|
||
| WASM_EXPORT bool multisig_construct_signature_round_2(uint8_t const* message, | ||
| size_t msg_len, | ||
| uint8_t* private_key, | ||
| uint8_t* signer_round_one_private_buf, | ||
| uint8_t* signer_pubkeys_buf, | ||
| uint8_t* round_one_public_buf, | ||
| uint8_t* round_two_buf); | ||
|
|
||
| WASM_EXPORT bool multisig_combine_signatures(uint8_t const* message, | ||
| size_t msg_len, | ||
| uint8_t* signer_pubkeys_buf, | ||
| uint8_t* round_one_buf, | ||
| uint8_t* round_two_buf, | ||
| uint8_t* s, | ||
| uint8_t* e); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
cpp/src/aztec/ecc/curves/bn254/scalar_multiplication/c_bind.hpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| #include <cstddef> | ||
| #include "../g1.hpp" | ||
|
|
||
| #define WASM_EXPORT __attribute__((visibility("default"))) | ||
|
|
||
| extern "C" { | ||
|
|
||
| WASM_EXPORT void* bbmalloc(size_t size); | ||
|
|
||
| WASM_EXPORT void bbfree(void* ptr); | ||
|
|
||
| WASM_EXPORT void* new_pippenger(uint8_t* points, size_t num_points); | ||
|
|
||
| WASM_EXPORT void delete_pippenger(void* pippenger); | ||
|
|
||
| WASM_EXPORT void pippenger_unsafe(void* pippenger_ptr, void* scalars_ptr, size_t from, size_t range, void* result_ptr); | ||
| WASM_EXPORT void g1_sum(void* points_ptr, size_t num_points, void* result_ptr); | ||
| } |
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.
Uh oh!
There was an error while loading. Please reload this page.