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
// === AUDIT STATUS ===
2
// internal: { status: not started, auditors: [], date: YYYY-MM-DD }
3
// external_1: { status: not started, auditors: [], date: YYYY-MM-DD }
4
// external_2: { status: not started, auditors: [], date: YYYY-MM-DD }
5
// =====================
6
7
#include "../bn254/fr.hpp"
8
#include "
barretenberg/common/wasm_export.hpp
"
9
10
using namespace
bb
;
11
12
WASM_EXPORT
void
bn254_fr_sqrt
(uint8_t
const
* input, uint8_t* result)
13
{
14
using
serialize::write
;
15
auto
input_fr = from_buffer<bb::fr>(input);
16
auto
[is_sqr, root] = input_fr.sqrt();
17
18
uint8_t* is_sqrt_result_ptr = result;
19
uint8_t* root_result_ptr = result + 1;
20
21
write
(is_sqrt_result_ptr, is_sqr);
22
write
(root_result_ptr, root);
23
}
24
25
// NOLINTEND(cert-dcl37-c, cert-dcl51-cpp, bugprone-reserved-identifier)
bn254_fr_sqrt
WASM_EXPORT void bn254_fr_sqrt(uint8_t const *input, uint8_t *result)
Definition
c_bind.cpp:12
bb
Entry point for Barretenberg command-line interface.
Definition
acir_format_getters.cpp:6
bb::write
void write(B &buf, field2< base_field, Params > const &value)
Definition
field2_declarations.hpp:155
serialize::write
void write(auto &buf, const msgpack_concepts::HasMsgPack auto &obj)
Automatically derived write for any object that defines .msgpack() (implicitly defined by MSGPACK_FIE...
Definition
serialize.hpp:538
wasm_export.hpp
WASM_EXPORT
#define WASM_EXPORT
Definition
wasm_export.hpp:8
src
barretenberg
ecc
curves
bn254
c_bind.cpp
Generated by
1.9.8