barretenberg
Loading...
Searching...
No Matches
witness_data.hpp
1#pragma once
2#include "../../native/value/value_note.hpp"
3#include "barretenberg/join_split_example/types.hpp"
4
5namespace join_split_example::proofs::notes::circuit::value {
6
7using namespace proof_system::plonk::stdlib;
8
10 group_ct owner;
11 suint_ct value;
12 field_ct secret;
13 suint_ct asset_id;
14 bool_ct account_required;
15 field_ct creator_pubkey;
16 field_ct input_nullifier;
17
19 {
20 secret = witness_ct(&builder, note.secret);
21 owner = group_ct(witness_ct(&builder, note.owner.x), witness_ct(&builder, note.owner.y), false);
22 owner.x = witness_ct(&builder, note.owner.x);
23 owner.y = witness_ct(&builder, note.owner.y);
24 value = suint_ct(witness_ct(&builder, note.value), NOTE_VALUE_BIT_LENGTH, "note_value");
25 asset_id = suint_ct(witness_ct(&builder, note.asset_id), ASSET_ID_BIT_LENGTH, "asset_id");
26 account_required = bool_ct(witness_ct(&builder, note.account_required));
27 creator_pubkey = witness_ct(&builder, note.creator_pubkey);
28 input_nullifier = witness_ct(&builder, note.input_nullifier);
29 }
30};
31
32} // namespace join_split_example::proofs::notes::circuit::value
Definition: ultra_circuit_builder.hpp:31
Definition: field.hpp:10
Definition: safe_uint.hpp:17
Definition: witness.hpp:10