Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
c_bind.cpp
Go to the documentation of this file.
1#include "../bn254/fr.hpp"
3
4using namespace bb;
5
6WASM_EXPORT void bn254_fr_sqrt(uint8_t const* input, uint8_t* result)
7{
9 auto input_fr = from_buffer<bb::fr>(input);
10 auto [is_sqr, root] = input_fr.sqrt();
11
12 uint8_t* is_sqrt_result_ptr = result;
13 uint8_t* root_result_ptr = result + 1;
14
15 write(is_sqrt_result_ptr, is_sqr);
16 write(root_result_ptr, root);
17}
18
19// NOLINTEND(cert-dcl37-c, cert-dcl51-cpp, bugprone-reserved-identifier)
WASM_EXPORT void bn254_fr_sqrt(uint8_t const *input, uint8_t *result)
Definition c_bind.cpp:6
Entry point for Barretenberg command-line interface.
Definition api.hpp:5
void write(B &buf, field2< base_field, Params > const &value)
void write(auto &buf, const msgpack_concepts::HasMsgPack auto &obj)
Automatically derived write for any object that defines .msgpack() (implicitly defined by MSGPACK_FIE...
#define WASM_EXPORT