nil::crypto3::zk::components::sha256_hash_component< FieldType > Class Template Reference

#include <sha256_component.hpp>

+ Inheritance diagram for nil::crypto3::zk::components::sha256_hash_component< FieldType >:
+ Collaboration diagram for nil::crypto3::zk::components::sha256_hash_component< FieldType >:

Public Types

typedef std::vector< bool > hash_value_type
 
typedef digest_variable< FieldType > hash_variable_type
 
typedef snark::merkle_authentication_path merkle_authentication_path_type
 

Public Member Functions

void generate_r1cs_constraints (bool ensure_output_bitness=true)
 
void generate_r1cs_witness ()
 
 sha256_hash_component (blueprint< FieldType > &bp, std::size_t input_len, const block_variable< FieldType > &block_input, const digest_variable< FieldType > &output)
 

Static Public Member Functions

static std::size_t get_block_len ()
 
static std::size_t get_digest_len ()
 
static std::vector< bool > get_hash (const std::vector< bool > &input)
 

Public Attributes

std::vector< blueprint_variable_vector< FieldType > > blocks_bits
 
std::vector< std::shared_ptr< sha256_compression_function_component< FieldType > > > blocks_components
 
std::vector< std::shared_ptr< digest_variable< FieldType > > > intermediate_outputs
 
std::shared_ptr< merkle_damagard_padding< FieldType > > padding
 

Protected Attributes

blueprint< FieldType > & bp
 

Detailed Description

template<typename FieldType>
class nil::crypto3::zk::components::sha256_hash_component< FieldType >

Component for arbitary length sha256 hash based on Merkle-Damagard padding. (i.e. standard sha256).

Member Typedef Documentation

◆ hash_value_type

template<typename FieldType >
typedef std::vector<bool> nil::crypto3::zk::components::sha256_hash_component< FieldType >::hash_value_type

◆ hash_variable_type

template<typename FieldType >
typedef digest_variable<FieldType> nil::crypto3::zk::components::sha256_hash_component< FieldType >::hash_variable_type

◆ merkle_authentication_path_type

Constructor & Destructor Documentation

◆ sha256_hash_component()

template<typename FieldType >
nil::crypto3::zk::components::sha256_hash_component< FieldType >::sha256_hash_component ( blueprint< FieldType > &  bp,
std::size_t  input_len,
const block_variable< FieldType > &  block_input,
const digest_variable< FieldType > &  output 
)
inline

Member Function Documentation

◆ generate_r1cs_constraints()

template<typename FieldType >
void nil::crypto3::zk::components::sha256_hash_component< FieldType >::generate_r1cs_constraints ( bool  ensure_output_bitness = true)
inline

◆ generate_r1cs_witness()

template<typename FieldType >
void nil::crypto3::zk::components::sha256_hash_component< FieldType >::generate_r1cs_witness ( )
inline

◆ get_block_len()

template<typename FieldType >
static std::size_t nil::crypto3::zk::components::sha256_hash_component< FieldType >::get_block_len ( )
inlinestatic

◆ get_digest_len()

template<typename FieldType >
static std::size_t nil::crypto3::zk::components::sha256_hash_component< FieldType >::get_digest_len ( )
inlinestatic

◆ get_hash()

template<typename FieldType >
static std::vector<bool> nil::crypto3::zk::components::sha256_hash_component< FieldType >::get_hash ( const std::vector< bool > &  input)
inlinestatic

Member Data Documentation

◆ blocks_bits

template<typename FieldType >
std::vector<blueprint_variable_vector<FieldType> > nil::crypto3::zk::components::sha256_hash_component< FieldType >::blocks_bits

◆ blocks_components

template<typename FieldType >
std::vector<std::shared_ptr<sha256_compression_function_component<FieldType> > > nil::crypto3::zk::components::sha256_hash_component< FieldType >::blocks_components

◆ bp

template<typename FieldType >
blueprint<FieldType>& nil::crypto3::zk::components::component< FieldType >::bp
protectedinherited

◆ intermediate_outputs

template<typename FieldType >
std::vector<std::shared_ptr<digest_variable<FieldType> > > nil::crypto3::zk::components::sha256_hash_component< FieldType >::intermediate_outputs

◆ padding

template<typename FieldType >
std::shared_ptr<merkle_damagard_padding<FieldType> > nil::crypto3::zk::components::sha256_hash_component< FieldType >::padding

The documentation for this class was generated from the following file: