-
Notifications
You must be signed in to change notification settings - Fork 295
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Ensure barretenberg provides headers that Noir needs (#200)
- Loading branch information
Showing
6 changed files
with
109 additions
and
6 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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
barretenberg/cpp/src/aztec/ecc/curves/bn254/scalar_multiplication/c_bind.hpp
This file contains 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); | ||
} |