#include <openssl/opensslconf.h>
#include <stdlib.h>
#include <string.h>
#include <openssl/crypto.h>
#include <openssl/sha.h>
#include <openssl/opensslv.h>
#include "md32_common.h"
Go to the source code of this file.
|
#define | DATA_ORDER_IS_BIG_ENDIAN |
|
#define | HASH_LONG SHA_LONG |
|
#define | HASH_CTX SHA256_CTX |
|
#define | HASH_CBLOCK SHA_CBLOCK |
|
#define | HASH_MAKE_STRING(c, s) |
|
#define | HASH_UPDATE SHA256_Update |
|
#define | HASH_TRANSFORM SHA256_Transform |
|
#define | HASH_FINAL SHA256_Final |
|
#define | HASH_BLOCK_DATA_ORDER sha256_block_data_order |
|
#define | Sigma0(x) (ROTATE((x),30) ^ ROTATE((x),19) ^ ROTATE((x),10)) |
|
#define | Sigma1(x) (ROTATE((x),26) ^ ROTATE((x),21) ^ ROTATE((x),7)) |
|
#define | sigma0(x) (ROTATE((x),25) ^ ROTATE((x),14) ^ ((x)>>3)) |
|
#define | sigma1(x) (ROTATE((x),15) ^ ROTATE((x),13) ^ ((x)>>10)) |
|
#define | Ch(x, y, z) (((x) & (y)) ^ ((~(x)) & (z))) |
|
#define | Maj(x, y, z) (((x) & (y)) ^ ((x) & (z)) ^ ((y) & (z))) |
|
#define | ROUND_00_15(i, a, b, c, d, e, f, g, h) |
|
#define | ROUND_16_63(i, a, b, c, d, e, f, g, h, X) |
|
#define Ch |
( |
|
x, |
|
|
|
y, |
|
|
|
z |
|
) |
| (((x) & (y)) ^ ((~(x)) & (z))) |
#define DATA_ORDER_IS_BIG_ENDIAN |
#define HASH_BLOCK_DATA_ORDER sha256_block_data_order |
#define HASH_MAKE_STRING |
( |
|
c, |
|
|
|
s |
|
) |
| |
Value:do { \
unsigned long ll; \
unsigned int nn; \
switch ((c)->md_len) \
{ ll=(
c)->
h[nn]; HOST_l2c(ll,(s)); } \
break; \
{ ll=(
c)->
h[nn]; HOST_l2c(ll,(s)); } \
break; \
default: \
return 0; \
for (nn=0;nn<(
c)->md_len/4;nn++) \
{ ll=(
c)->
h[nn]; HOST_l2c(ll,(s)); } \
break; \
} \
} while (0)
Definition at line 85 of file sha256.c.
#define Maj |
( |
|
x, |
|
|
|
y, |
|
|
|
z |
|
) |
| (((x) & (y)) ^ ((x) & (z)) ^ ((y) & (z))) |
#define ROUND_00_15 |
( |
|
i, |
|
|
|
a, |
|
|
|
b, |
|
|
|
c, |
|
|
|
d, |
|
|
|
e, |
|
|
|
f, |
|
|
|
g, |
|
|
|
h |
|
) |
| |
Value:do { \
d += T1;
h += T1; }
while (0)
Definition at line 192 of file sha256.c.
#define ROUND_16_63 |
( |
|
i, |
|
|
|
a, |
|
|
|
b, |
|
|
|
c, |
|
|
|
d, |
|
|
|
e, |
|
|
|
f, |
|
|
|
g, |
|
|
|
h, |
|
|
|
X |
|
) |
| |
Value:do { \
s0 =
X[(i+1)&0x0f]; s0 =
sigma0(s0); \
s1 =
X[(i+14)&0x0f]; s1 =
sigma1(s1); \
T1 =
X[(i)&0x0f] += s0 + s1 +
X[(i+9)&0x0f]; \
ROUND_00_15(i,
a,
b,c,d,
e,
f,g,
h); }
while (0)
Definition at line 197 of file sha256.c.
#define sigma0 |
( |
|
x | ) |
(ROTATE((x),25) ^ ROTATE((x),14) ^ ((x)>>3)) |
#define sigma1 |
( |
|
x | ) |
(ROTATE((x),15) ^ ROTATE((x),13) ^ ((x)>>10)) |
unsigned char* SHA224 |
( |
const unsigned char * |
d, |
|
|
size_t |
n, |
|
|
unsigned char * |
md |
|
) |
| |
int SHA224_Final |
( |
unsigned char * |
md, |
|
|
SHA256_CTX * |
c |
|
) |
| |
unsigned char* SHA256 |
( |
const unsigned char * |
d, |
|
|
size_t |
n, |
|
|
unsigned char * |
md |
|
) |
| |
const char SHA256_version[] ="SHA-256" OPENSSL_VERSION_PTEXT |