Eneboo - Documentación para desarrolladores
'defines' | Funciones | Variables
Referencia del Archivo src/libdigidoc/openssl/crypto/sha/sha512.c
#include <openssl/opensslconf.h>
#include <stdlib.h>
#include <string.h>
#include <openssl/crypto.h>
#include <openssl/sha.h>
#include <openssl/opensslv.h>
#include "cryptlib.h"

'defines'

#define B(x, j)   (((SHA_LONG64)(*(((const unsigned char *)(&x))+j)))<<((7-j)*8))
#define PULL64(x)   (B(x,0)|B(x,1)|B(x,2)|B(x,3)|B(x,4)|B(x,5)|B(x,6)|B(x,7))
#define ROTR(x, s)   (((x)>>s) | (x)<<(64-s))
#define Sigma0(x)   (ROTR((x),28) ^ ROTR((x),34) ^ ROTR((x),39))
#define Sigma1(x)   (ROTR((x),14) ^ ROTR((x),18) ^ ROTR((x),41))
#define sigma0(x)   (ROTR((x),1) ^ ROTR((x),8) ^ ((x)>>7))
#define sigma1(x)   (ROTR((x),19) ^ ROTR((x),61) ^ ((x)>>6))
#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_80(i, a, b, c, d, e, f, g, h, X)

Funciones

int SHA384_Init (SHA512_CTX *c)
int SHA512_Init (SHA512_CTX *c)
int SHA512_Final (unsigned char *md, SHA512_CTX *c)
int SHA384_Final (unsigned char *md, SHA512_CTX *c)
int SHA512_Update (SHA512_CTX *c, const void *_data, size_t len)
int SHA384_Update (SHA512_CTX *c, const void *data, size_t len)
void SHA512_Transform (SHA512_CTX *c, const unsigned char *data)
unsigned char * SHA384 (const unsigned char *d, size_t n, unsigned char *md)
unsigned char * SHA512 (const unsigned char *d, size_t n, unsigned char *md)

Variables

const char SHA512_version [] = "SHA-512" OPENSSL_VERSION_PTEXT

Documentación de los 'defines'

#define B (   x,
 
)    (((SHA_LONG64)(*(((const unsigned char *)(&x))+j)))<<((7-j)*8))
#define Ch (   x,
  y,
 
)    (((x) & (y)) ^ ((~(x)) & (z)))
#define Maj (   x,
  y,
 
)    (((x) & (y)) ^ ((x) & (z)) ^ ((y) & (z)))
#define PULL64 (   x)    (B(x,0)|B(x,1)|B(x,2)|B(x,3)|B(x,4)|B(x,5)|B(x,6)|B(x,7))
#define ROTR (   x,
  s 
)    (((x)>>s) | (x)<<(64-s))
#define ROUND_00_15 (   i,
  a,
  b,
  c,
  d,
  e,
  f,
  g,
 
)
Valor:
do {    \
        T1 += h + Sigma1(e) + Ch(e,f,g) + K512[i];      \
        h = Sigma0(a) + Maj(a,b,c);                     \
        d += T1;        h += T1;                } while (0)
#define ROUND_16_80 (   i,
  a,
  b,
  c,
  d,
  e,
  f,
  g,
  h,
 
)
Valor:
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)
#define sigma0 (   x)    (ROTR((x),1) ^ ROTR((x),8) ^ ((x)>>7))
#define Sigma0 (   x)    (ROTR((x),28) ^ ROTR((x),34) ^ ROTR((x),39))
#define sigma1 (   x)    (ROTR((x),19) ^ ROTR((x),61) ^ ((x)>>6))
#define Sigma1 (   x)    (ROTR((x),14) ^ ROTR((x),18) ^ ROTR((x),41))

Documentación de las funciones

unsigned char* SHA384 ( const unsigned char *  d,
size_t  n,
unsigned char *  md 
)
int SHA384_Final ( unsigned char *  md,
SHA512_CTX c 
)
int SHA384_Init ( SHA512_CTX c)
int SHA384_Update ( SHA512_CTX c,
const void *  data,
size_t  len 
)
unsigned char* SHA512 ( const unsigned char *  d,
size_t  n,
unsigned char *  md 
)
int SHA512_Final ( unsigned char *  md,
SHA512_CTX c 
)
int SHA512_Init ( SHA512_CTX c)
void SHA512_Transform ( SHA512_CTX c,
const unsigned char *  data 
)
int SHA512_Update ( SHA512_CTX c,
const void *  _data,
size_t  len 
)

Documentación de las variables

const char SHA512_version[] = "SHA-512" OPENSSL_VERSION_PTEXT
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'