PandA-2024.02
Data Structures | Macros | Functions | Variables
sha-256.c File Reference
#include <stdint.h>
#include <string.h>
#include "sha-256.h"
Include dependency graph for sha-256.c:

Go to the source code of this file.

Data Structures

struct  buffer_state
 

Macros

#define CHUNK_SIZE   64
 
#define TOTAL_LEN_LEN   8
 

Functions

static uint32_t right_rot (uint32_t value, unsigned int count)
 
static void init_buf_state (struct buffer_state *state, const void *input, size_t len)
 
static int calc_chunk (uint8_t chunk[CHUNK_SIZE], struct buffer_state *state)
 
void calc_sha_256 (uint8_t hash[32], const void *input, size_t len)
 

Variables

static const uint32_t k []
 

Macro Definition Documentation

◆ CHUNK_SIZE

#define CHUNK_SIZE   64

Definition at line 6 of file sha-256.c.

Referenced by calc_chunk().

◆ TOTAL_LEN_LEN

#define TOTAL_LEN_LEN   8

Definition at line 7 of file sha-256.c.

Referenced by calc_chunk().

Function Documentation

◆ calc_chunk()

static int calc_chunk ( uint8_t  chunk[CHUNK_SIZE],
struct buffer_state state 
)
static

Definition at line 60 of file sha-256.c.

References CHUNK_SIZE, buffer_state::len, buffer_state::p, buffer_state::single_one_delivered, buffer_state::total_len, buffer_state::total_len_delivered, and TOTAL_LEN_LEN.

Referenced by calc_sha_256().

Here is the caller graph for this function:

◆ calc_sha_256()

void calc_sha_256 ( uint8_t  hash[32],
const void *  input,
size_t  len 
)

Definition at line 124 of file sha-256.c.

References calc_chunk(), h, init_buf_state(), k, buffer_state::p, and right_rot().

Here is the call graph for this function:

◆ init_buf_state()

static void init_buf_state ( struct buffer_state state,
const void *  input,
size_t  len 
)
static

Definition at line 50 of file sha-256.c.

References input, buffer_state::len, buffer_state::p, buffer_state::single_one_delivered, buffer_state::total_len, and buffer_state::total_len_delivered.

Referenced by calc_sha_256().

Here is the caller graph for this function:

◆ right_rot()

static uint32_t right_rot ( uint32_t  value,
unsigned int  count 
)
inlinestatic

Definition at line 41 of file sha-256.c.

Referenced by calc_sha_256().

Here is the caller graph for this function:

Variable Documentation

◆ k

const uint32_t k[]
static
Initial value:
= {
0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,
0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,
0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,
0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2
}

Definition at line 22 of file sha-256.c.

Referenced by __attribute__(), add_directed_edge(), pragma_manager::addFunctionCallPragmas(), Autocorrelation(), bbgemm(), blowfish_main(), structural_manager::build_graph(), buildNeighborList(), dom_info< GraphObj >::calc_idoms(), calc_sha_256(), lut_transformation::CHECK_BIN_EXPR_INT_SIZE(), check_data(), CPF(), compatibility_based_register::create_compatibility_graph(), conflict_based_register::create_conflict_graph(), fsm_controller::create_state_machine(), DecodeHuffMCU(), Doolittle_LU_Decomposition(), TestbenchGeneration::Exec(), FFT(), port_o::find_isomorphic(), constant_o::find_isomorphic(), fixedpt_exp(), fused_nn_dense_add(), gemm(), TestbenchGeneration::generate_init_file(), get_uniform_fixed(), tree_node::GetString(), gsm_div(), helm_factor_impl(), helm_naive(), init_array(), values_scheme::InternalExec(), cdfc_module_binding::InternalExec(), main(), boost::maxclique_dsatur_coloring_helper< VertexListGraph, ColorMap, size_type, SET_container >::MaxCliqueRec(), merge(), mm(), HostProfiling::normalize(), firFixedClass< filter_len >::operator()(), FunctionCallTypeCleanup::ParametersTypeCleanup(), parse_string(), plot_test(), polybench_flush_cache(), print_array(), BehavioralHelper::PrintNode(), PseudoCasual(), qsort_r(), vertex_coloring_register::RegisterBinding(), chordal_coloring_register::RegisterBinding(), weighted_clique_register::RegisterBinding(), structural_manager::remove_module(), ShuffleVector(), stencil3d(), network_flow::successive_shortest_path_algorithm(), tree_node::tree_node(), Unit_Lower_Triangular_Solve(), update_knn(), Upper_Triangular_Solve(), and HDL_manager::write_module().


Generated on Mon Feb 12 2024 13:03:12 for PandA-2024.02 by doxygen 1.8.13