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
8#include "sha256.hpp"
9
10using namespace bb;
11
12WASM_EXPORT void sha256__hash(uint8_t* in, const size_t length, uint8_t* r)
13{
14 std::vector<uint8_t> message;
15 message.reserve(length);
16 for (size_t i = 0; i < length; ++i) {
17 message.emplace_back(in[i]);
18 }
19 const auto output = crypto::sha256(message);
20 for (size_t i = 0; i < 32; ++i) {
21 r[i] = output[i];
22 }
23}
WASM_EXPORT void sha256__hash(uint8_t *in, const size_t length, uint8_t *r)
Definition c_bind.cpp:12
uint8_t const size_t length
Definition data_store.hpp:9
Sha256Hash sha256(const ByteContainer &input)
Definition sha256.cpp:142
Entry point for Barretenberg command-line interface.
#define WASM_EXPORT