FFmpeg
|
#include <string.h>
#include "avutil.h"
#include "bswap.h"
#include "sha.h"
#include "intreadwrite.h"
#include "mem.h"
Go to the source code of this file.
Data Structures | |
struct | AVSHA |
hash context More... | |
Macros | |
#define | rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits)))) |
#define | blk0(i) (block[i] = AV_RB32(buffer + 4 * (i))) |
#define | blk(i) (block[i] = rol(block[i-3] ^ block[i-8] ^ block[i-14] ^ block[i-16], 1)) |
#define | R0(v, w, x, y, z, i) z += ((w&(x^y))^y) + blk0(i) + 0x5A827999 + rol(v, 5); w = rol(w, 30); |
#define | R1(v, w, x, y, z, i) z += ((w&(x^y))^y) + blk (i) + 0x5A827999 + rol(v, 5); w = rol(w, 30); |
#define | R2(v, w, x, y, z, i) z += ( w^x ^y) + blk (i) + 0x6ED9EBA1 + rol(v, 5); w = rol(w, 30); |
#define | R3(v, w, x, y, z, i) z += (((w|x)&y)|(w&x)) + blk (i) + 0x8F1BBCDC + rol(v, 5); w = rol(w, 30); |
#define | R4(v, w, x, y, z, i) z += ( w^x ^y) + blk (i) + 0xCA62C1D6 + rol(v, 5); w = rol(w, 30); |
#define | Ch(x, y, z) (((x) & ((y) ^ (z))) ^ (z)) |
#define | Maj(x, y, z) ((((x) | (y)) & (z)) | ((x) & (y))) |
#define | Sigma0_256(x) (rol((x), 30) ^ rol((x), 19) ^ rol((x), 10)) |
#define | Sigma1_256(x) (rol((x), 26) ^ rol((x), 21) ^ rol((x), 7)) |
#define | sigma0_256(x) (rol((x), 25) ^ rol((x), 14) ^ ((x) >> 3)) |
#define | sigma1_256(x) (rol((x), 15) ^ rol((x), 13) ^ ((x) >> 10)) |
#define | blk(i) |
#define | ROUND256(a, b, c, d, e, f, g, h) |
#define | ROUND256_0_TO_15(a, b, c, d, e, f, g, h) |
#define | ROUND256_16_TO_63(a, b, c, d, e, f, g, h) |
Functions | |
struct AVSHA * | av_sha_alloc (void) |
Allocate an AVSHA context. | |
static void | sha1_transform (uint32_t state[5], const uint8_t buffer[64]) |
static void | sha256_transform (uint32_t *state, const uint8_t buffer[64]) |
int | av_sha_init (AVSHA *ctx, int bits) |
Initialize SHA-1 or SHA-2 hashing. | |
void | av_sha_update (AVSHA *ctx, const uint8_t *data, unsigned int len) |
Update hash value. | |
void | av_sha_final (AVSHA *ctx, uint8_t *digest) |
Finish hashing and output digest value. | |
Variables | |
const int | av_sha_size = sizeof(AVSHA) |
static const uint32_t | K256 [64] |
Definition at line 48 of file sha.c.
Referenced by sha1_transform().
Definition at line 51 of file sha.c.
Referenced by sha256_transform().
Definition at line 169 of file sha.c.
Referenced by ac3_compute_mantissa_size_c(), ac3_decode_frame(), ac3_exponent_min_c(), allocate_buffers(), apply_channel_coupling(), apply_mdct(), bink_decode_plane(), binkb_decode_plane(), bit_alloc(), bit_alloc_masking(), compute_exp_strategy(), compute_rematrixing_strategy(), count_exponent_bits(), count_frame_bits(), count_frame_bits_fixed(), count_mantissa_bits_init(), count_mantissa_bits_update_ch(), decode_audio_block(), decode_frame(), decode_transform_coeffs_ch(), dv_calc_mb_coordinates(), dv_init_enc_block(), encode_exponents(), ff_ac3_apply_rematrixing(), ff_ac3_compute_coupling_strategy(), ff_ac3_encode_close(), ff_ac3_group_exponents(), ff_ac3_output_frame(), ff_ac3_quantize_mantissas(), ff_eac3_decode_transform_coeffs_aht_ch(), ff_eac3_output_frame_header(), ff_eac3_parse_header(), ff_eac3_set_cpl_states(), ivi_decode_blocks(), ivi_process_empty_tile(), output_audio_block(), reset_block_bap(), scale_coefficients(), set_bandwidth(), sha256_transform(), and vb_decode_framedata().
#define R0 | ( | v, | |
w, | |||
x, | |||
y, | |||
z, | |||
i | |||
) | z += ((w&(x^y))^y) + blk0(i) + 0x5A827999 + rol(v, 5); w = rol(w, 30); |
Definition at line 54 of file sha.c.
Referenced by altivec_uyvy_rgb32(), ff_yuv2packedX_altivec(), and sha1_transform().
#define R1 | ( | v, | |
w, | |||
x, | |||
y, | |||
z, | |||
i | |||
) | z += ((w&(x^y))^y) + blk (i) + 0x5A827999 + rol(v, 5); w = rol(w, 30); |
Definition at line 55 of file sha.c.
Referenced by sha1_transform().
Definition at line 56 of file sha.c.
Referenced by sha1_transform().
#define R3 | ( | v, | |
w, | |||
x, | |||
y, | |||
z, | |||
i | |||
) | z += (((w|x)&y)|(w&x)) + blk (i) + 0x8F1BBCDC + rol(v, 5); w = rol(w, 30); |
Definition at line 57 of file sha.c.
Referenced by sha1_transform().
Definition at line 58 of file sha.c.
Referenced by sha1_transform().
Definition at line 160 of file sha.c.
Referenced by sha256_transform().
Definition at line 161 of file sha.c.
Referenced by sha256_transform().
Definition at line 163 of file sha.c.
Referenced by sha256_transform().
Definition at line 164 of file sha.c.
Referenced by sha256_transform().
#define blk | ( | i | ) |
Definition at line 62 of file sha.c.
Referenced by av_sha_init().
Definition at line 186 of file sha.c.
Referenced by av_sha_init().
|
static |
Definition at line 140 of file sha.c.
Referenced by sha256_transform().