libavutil/sha1.c File Reference

#include "common.h"
#include "bswap.h"
#include "sha1.h"

Go to the source code of this file.

Data Structures

struct  AVSHA1

Defines

#define rol(value, bits)   (((value) << (bits)) | ((value) >> (32 - (bits))))
#define blk0(i)   (block[i] = be2me_32(((const uint32_t*)buffer)[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);

Functions

static void transform (uint32_t state[5], const uint8_t buffer[64])
void av_sha1_init (AVSHA1 *ctx)
void av_sha1_update (AVSHA1 *ctx, const uint8_t *data, unsigned int len)
void av_sha1_final (AVSHA1 *ctx, uint8_t digest[20])

Variables

const int av_sha1_size = sizeof(AVSHA1)


Define Documentation

#define blk (  )     (block[i] = rol(block[i-3]^block[i-8]^block[i-14]^block[i-16],1))

#define blk0 (  )     (block[i] = be2me_32(((const uint32_t*)buffer)[i]))

Definition at line 37 of file sha1.c.

#define R0 ( v,
w,
x,
y,
z,
 )     z+=((w&(x^y))^y) +blk0(i)+0x5A827999+rol(v,5);w=rol(w,30);

Definition at line 40 of file sha1.c.

Referenced by altivec_uyvy_rgb32(), altivec_yuv2packedX(), and transform().

#define R1 ( v,
w,
x,
y,
z,
 )     z+=((w&(x^y))^y) +blk (i)+0x5A827999+rol(v,5);w=rol(w,30);

Definition at line 41 of file sha1.c.

#define R2 ( v,
w,
x,
y,
z,
 )     z+=( w^x ^y) +blk (i)+0x6ED9EBA1+rol(v,5);w=rol(w,30);

Definition at line 42 of file sha1.c.

#define R3 ( v,
w,
x,
y,
z,
 )     z+=(((w|x)&y)|(w&x))+blk (i)+0x8F1BBCDC+rol(v,5);w=rol(w,30);

Definition at line 43 of file sha1.c.

#define R4 ( v,
w,
x,
y,
z,
 )     z+=( w^x ^y) +blk (i)+0xCA62C1D6+rol(v,5);w=rol(w,30);

Definition at line 44 of file sha1.c.

Referenced by transform().

#define rol ( value,
bits   )     (((value) << (bits)) | ((value) >> (32 - (bits))))

Definition at line 34 of file sha1.c.

Referenced by transform().


Function Documentation

void av_sha1_final ( AVSHA1 ctx,
uint8_t  digest[20] 
)

Definition at line 135 of file sha1.c.

void av_sha1_init ( AVSHA1 ctx  ) 

Definition at line 99 of file sha1.c.

void av_sha1_update ( AVSHA1 ctx,
const uint8_t *  data,
unsigned int  len 
)

Definition at line 108 of file sha1.c.

Referenced by av_sha1_final().

static void transform ( uint32_t  state[5],
const uint8_t  buffer[64] 
) [static]

Definition at line 48 of file sha1.c.

Referenced by av_sha1_update(), and reverse_dc_prediction().


Variable Documentation

const int av_sha1_size = sizeof(AVSHA1)

Definition at line 32 of file sha1.c.


Generated on Fri Oct 26 02:35:46 2012 for FFmpeg by  doxygen 1.5.8