FFmpeg 5.1.4
Files | Functions | Variables

SHA-512 (Secure Hash Algorithm) hash function implementations. More...

Files

file  sha512.h
 Public header for SHA-512 implementation.
 

Functions

struct AVSHA512 * av_sha512_alloc (void)
 Allocate an AVSHA512 context. More...
 
int av_sha512_init (struct AVSHA512 *context, int bits)
 Initialize SHA-2 512 hashing. More...
 
void av_sha512_update (struct AVSHA512 *context, const uint8_t *data, size_t len)
 Update hash value. More...
 
void av_sha512_final (struct AVSHA512 *context, uint8_t *digest)
 Finish hashing and output digest value. More...
 

Variables

const int av_sha512_size
 

Detailed Description

SHA-512 (Secure Hash Algorithm) hash function implementations.

This module supports the following SHA-2 hash functions:

See also
For SHA-1, SHA-256, and variants thereof, see SHA.

Function Documentation

◆ av_sha512_alloc()

struct AVSHA512 * av_sha512_alloc ( void  )

Allocate an AVSHA512 context.

◆ av_sha512_init()

int av_sha512_init ( struct AVSHA512 *  context,
int  bits 
)

Initialize SHA-2 512 hashing.

Parameters
contextpointer to the function context (of size av_sha512_size)
bitsnumber of bits in digest (224, 256, 384 or 512 bits)
Returns
zero if initialization succeeded, -1 otherwise

◆ av_sha512_update()

void av_sha512_update ( struct AVSHA512 *  context,
const uint8_t *  data,
size_t  len 
)

Update hash value.

Parameters
contexthash function context
datainput data to update hash with
leninput data length

◆ av_sha512_final()

void av_sha512_final ( struct AVSHA512 *  context,
uint8_t *  digest 
)

Finish hashing and output digest value.

Parameters
contexthash function context
digestbuffer where output digest value is stored

Variable Documentation

◆ av_sha512_size

const int av_sha512_size
extern