Clearmatics Libsnark
0.1
C++ library for zkSNARK proofs
|
#include <sha256_gadget.hpp>
Public Types | |
typedef libff::bit_vector | hash_value_type |
typedef merkle_authentication_path | merkle_authentication_path_type |
Public Member Functions | |
sha256_two_to_one_hash_gadget (protoboard< FieldT > &pb, const digest_variable< FieldT > &left, const digest_variable< FieldT > &right, const digest_variable< FieldT > &output, const std::string &annotation_prefix) | |
sha256_two_to_one_hash_gadget (protoboard< FieldT > &pb, const size_t block_length, const block_variable< FieldT > &input_block, const digest_variable< FieldT > &output, const std::string &annotation_prefix) | |
void | generate_r1cs_constraints (const bool ensure_output_bitness=true) |
void | generate_r1cs_witness () |
![]() | |
gadget (protoboard< FieldT > &pb, const std::string &annotation_prefix) | |
Static Public Member Functions | |
static size_t | get_block_len () |
static size_t | get_digest_len () |
static libff::bit_vector | get_hash (const libff::bit_vector &input) |
static size_t | expected_constraints (const bool ensure_output_bitness=true) |
Public Attributes | |
std::shared_ptr< sha256_compression_function_gadget< FieldT > > | f |
Additional Inherited Members | |
![]() | |
protoboard< FieldT > & | pb |
const std::string | annotation_prefix |
Gadget for the SHA256 compression function, viewed as a 2-to-1 hash function, and using the same initialization vector as in SHA256 specification. Thus, any collision for sha256_two_to_one_hash_gadget trivially extends to a collision for full SHA256 (by appending the same padding).
Definition at line 70 of file sha256_gadget.hpp.
typedef libff::bit_vector libsnark::sha256_two_to_one_hash_gadget< FieldT >::hash_value_type |
Definition at line 73 of file sha256_gadget.hpp.
typedef merkle_authentication_path libsnark::sha256_two_to_one_hash_gadget< FieldT >::merkle_authentication_path_type |
Definition at line 74 of file sha256_gadget.hpp.
libsnark::sha256_two_to_one_hash_gadget< FieldT >::sha256_two_to_one_hash_gadget | ( | protoboard< FieldT > & | pb, |
const digest_variable< FieldT > & | left, | ||
const digest_variable< FieldT > & | right, | ||
const digest_variable< FieldT > & | output, | ||
const std::string & | annotation_prefix | ||
) |
libsnark::sha256_two_to_one_hash_gadget< FieldT >::sha256_two_to_one_hash_gadget | ( | protoboard< FieldT > & | pb, |
const size_t | block_length, | ||
const block_variable< FieldT > & | input_block, | ||
const digest_variable< FieldT > & | output, | ||
const std::string & | annotation_prefix | ||
) |
|
static |
void libsnark::sha256_two_to_one_hash_gadget< FieldT >::generate_r1cs_constraints | ( | const bool | ensure_output_bitness = true | ) |
void libsnark::sha256_two_to_one_hash_gadget< FieldT >::generate_r1cs_witness | ( | ) |
|
static |
|
static |
|
static |
std::shared_ptr<sha256_compression_function_gadget<FieldT> > libsnark::sha256_two_to_one_hash_gadget< FieldT >::f |
Definition at line 76 of file sha256_gadget.hpp.