drizzle
C++ MySQL-protocol-compatible database server
Loading...
Searching...
No Matches
sha1.cc File Reference

SHA1 Definitions. More...

#include <config.h>
#include "sha1.h"
#include <endian.h>
#include <string.h>
Include dependency graph for sha1.cc:

Go to the source code of this file.

Namespaces

namespace  drizzled
 TODO: Rename this file - func.h is stupid.

Macros

#define rol(value, bits)
#define blk0(i)
#define blk(i)
#define R0(v, w, x, y, z, i)
#define R1(v, w, x, y, z, i)
#define R2(v, w, x, y, z, i)
#define R3(v, w, x, y, z, i)
#define R4(v, w, x, y, z, i)

Functions

void drizzled::SHA1Transform (uint32_t state[5], const uint8_t buffer[SHA1_BLOCK_LENGTH])
void drizzled::SHA1Init (SHA1_CTX *context)
void drizzled::SHA1Update (SHA1_CTX *context, const uint8_t *data, size_t len)
void drizzled::SHA1Pad (SHA1_CTX *context)
void drizzled::SHA1Final (uint8_t digest[SHA1_DIGEST_LENGTH], SHA1_CTX *context)
void drizzled::do_sha1 (data_ref in, uint8_t out[SHA1_DIGEST_LENGTH])

Detailed Description

SHA1 Definitions.

Definition in file sha1.cc.

Macro Definition Documentation

◆ blk

#define blk ( i)
Value:
(block->l[i&15] = rol(block->l[(i+13)&15]^block->l[(i+8)&15] \
^block->l[(i+2)&15]^block->l[i&15],1))

Definition at line 45 of file sha1.cc.

◆ blk0

#define blk0 ( i)
Value:
(block->l[i] = (rol(block->l[i],24)&0xFF00FF00) \
|(rol(block->l[i],8)&0x00FF00FF))

Definition at line 40 of file sha1.cc.

◆ R0

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

Definition at line 51 of file sha1.cc.

◆ R1

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

Definition at line 52 of file sha1.cc.

◆ R2

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

Definition at line 53 of file sha1.cc.

◆ R3

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

Definition at line 54 of file sha1.cc.

◆ R4

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

Definition at line 55 of file sha1.cc.

◆ rol

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

Definition at line 33 of file sha1.cc.