Eneboo - Documentación para desarrolladores
|
#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"
'defines' | |
#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) |
Funciones | |
int | SHA224_Init (SHA256_CTX *c) |
int | SHA256_Init (SHA256_CTX *c) |
unsigned char * | SHA224 (const unsigned char *d, size_t n, unsigned char *md) |
unsigned char * | SHA256 (const unsigned char *d, size_t n, unsigned char *md) |
int | SHA224_Update (SHA256_CTX *c, const void *data, size_t len) |
int | SHA224_Final (unsigned char *md, SHA256_CTX *c) |
Variables | |
const char | SHA256_version [] = "SHA-256" OPENSSL_VERSION_PTEXT |
#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_CBLOCK SHA_CBLOCK |
#define HASH_CTX SHA256_CTX |
#define HASH_FINAL SHA256_Final |
#define HASH_LONG SHA_LONG |
do { \ unsigned long ll; \ unsigned int xn; \ switch ((c)->md_len) \ { case SHA224_DIGEST_LENGTH: \ for (xn=0;xn<SHA224_DIGEST_LENGTH/4;xn++) \ { ll=(c)->h[xn]; HOST_l2c(ll,(s)); } \ break; \ case SHA256_DIGEST_LENGTH: \ for (xn=0;xn<SHA256_DIGEST_LENGTH/4;xn++) \ { ll=(c)->h[xn]; HOST_l2c(ll,(s)); } \ break; \ default: \ if ((c)->md_len > SHA256_DIGEST_LENGTH) \ return 0; \ for (xn=0;xn<(c)->md_len/4;xn++) \ { ll=(c)->h[xn]; HOST_l2c(ll,(s)); } \ break; \ } \ } while (0)
#define HASH_TRANSFORM SHA256_Transform |
#define HASH_UPDATE SHA256_Update |
#define Maj | ( | x, | |
y, | |||
z | |||
) | (((x) & (y)) ^ ((x) & (z)) ^ ((y) & (z))) |
#define sigma0 | ( | x | ) | (ROTATE((x),25) ^ ROTATE((x),14) ^ ((x)>>3)) |
#define Sigma0 | ( | x | ) | (ROTATE((x),30) ^ ROTATE((x),19) ^ ROTATE((x),10)) |
#define sigma1 | ( | x | ) | (ROTATE((x),15) ^ ROTATE((x),13) ^ ((x)>>10)) |
#define Sigma1 | ( | x | ) | (ROTATE((x),26) ^ ROTATE((x),21) ^ ROTATE((x),7)) |
unsigned char* SHA224 | ( | const unsigned char * | d, |
size_t | n, | ||
unsigned char * | md | ||
) |
int SHA224_Final | ( | unsigned char * | md, |
SHA256_CTX * | c | ||
) |
int SHA224_Init | ( | SHA256_CTX * | c | ) |
int SHA224_Update | ( | SHA256_CTX * | c, |
const void * | data, | ||
size_t | len | ||
) |
unsigned char* SHA256 | ( | const unsigned char * | d, |
size_t | n, | ||
unsigned char * | md | ||
) |
int SHA256_Init | ( | SHA256_CTX * | c | ) |
const char SHA256_version[] = "SHA-256" OPENSSL_VERSION_PTEXT |