Pyrogenesis
trunk
|
Macros | |
#define | GET_uint32(n, b, i) |
FIPS-180-2 compliant SHA-256 implementation. More... | |
#define | PUT_uint32(n, b, i) |
#define | SHR(x, n) ((x & 0xFFFFFFFF) >> n) |
#define | ROTR(x, n) (SHR(x,n) | (x << (32 - n))) |
#define | S0(x) (ROTR(x, 7) ^ ROTR(x,18) ^ SHR(x, 3)) |
#define | S1(x) (ROTR(x,17) ^ ROTR(x,19) ^ SHR(x,10)) |
#define | S2(x) (ROTR(x, 2) ^ ROTR(x,13) ^ ROTR(x,22)) |
#define | S3(x) (ROTR(x, 6) ^ ROTR(x,11) ^ ROTR(x,25)) |
#define | F0(x, y, z) ((x & y) | (z & (x | y))) |
#define | F1(x, y, z) (z ^ (x & (y ^ z))) |
#define | R(t) |
#define | P(a, b, c, d, e, f, g, h, x, K) |
Variables | |
static unsigned char | sha256_padding [64] |
#define F0 | ( | x, | |
y, | |||
z | |||
) | ((x & y) | (z & (x | y))) |
#define F1 | ( | x, | |
y, | |||
z | |||
) | (z ^ (x & (y ^ z))) |
#define GET_uint32 | ( | n, | |
b, | |||
i | |||
) |
FIPS-180-2 compliant SHA-256 implementation.
Copyright (C) 2001-2003 Christophe Devine
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#define P | ( | a, | |
b, | |||
c, | |||
d, | |||
e, | |||
f, | |||
g, | |||
h, | |||
x, | |||
K | |||
) |
#define PUT_uint32 | ( | n, | |
b, | |||
i | |||
) |
#define R | ( | t | ) |
#define ROTR | ( | x, | |
n | |||
) | (SHR(x,n) | (x << (32 - n))) |
#define SHR | ( | x, | |
n | |||
) | ((x & 0xFFFFFFFF) >> n) |
|
static |