Main Page   Compound List   File List   Compound Members   File Members  

sha512.c File Reference

#include "sha512.h"

Include dependency graph for sha512.c:

Include dependency graph

Defines

#define Ch(x, y, z)   ((x & y) ^ (~x & z))
#define Maj(x, y, z)   ((x & y) ^ (x & z) ^ (y & z))
#define e0(x)   (RORuns64(x,28) ^ RORuns64(x,34) ^ RORuns64(x,39))
#define e1(x)   (RORuns64(x,14) ^ RORuns64(x,18) ^ RORuns64(x,41))
#define s0(x)   (RORuns64(x,1) ^ RORuns64(x,8) ^ (x >> 7))
#define s1(x)   (RORuns64(x,19) ^ RORuns64(x,61) ^ (x >> 6))
#define H0   0x6a09e667f3bcc908
#define H1   0xbb67ae8584caa73b
#define H2   0x3c6ef372fe94f82b
#define H3   0xa54ff53a5f1d36f1
#define H4   0x510e527fade682d1
#define H5   0x9b05688c2b3e6c1f
#define H6   0x1f83d9abfb41bd6b
#define H7   0x5be0cd19137e2179
#define LOAD_OP(I)
#define BLEND_OP(I)

Functions

void sha512_xform (uns64 *state, const uns8 *input)

Define Documentation

#define BLEND_OP( I )
 

Value:

  W[I  ] = s1(W[I-2]) + W[I-7] + s0(W[I-15]) + W[I-16];

#define Ch( x, y, z )   ((x & y) ^ (~x & z))
 

A contribution to the open-source movement. Jean-Luc Cooke <jlcooke@certainkey.com> CertainKey Inc. Ottawa Ontario Canada

Created: July 20th, 2001

The following program code is released under the GPL license http://www.gnu.org/copyleft/gpl.html

#define H0   0x6a09e667f3bcc908
 

#define H1   0xbb67ae8584caa73b
 

#define H2   0x3c6ef372fe94f82b
 

#define H3   0xa54ff53a5f1d36f1
 

#define H4   0x510e527fade682d1
 

#define H5   0x9b05688c2b3e6c1f
 

#define H6   0x1f83d9abfb41bd6b
 

#define H7   0x5be0cd19137e2179
 

#define LOAD_OP( I )
 

Value:

 {\
  t1  = input[(8*I)  ] & 0xff;   t1<<=8;\
  t1 |= input[(8*I)+1] & 0xff;   t1<<=8;\
  t1 |= input[(8*I)+2] & 0xff;   t1<<=8;\
  t1 |= input[(8*I)+3] & 0xff;   t1<<=8;\
  t1 |= input[(8*I)+4] & 0xff;   t1<<=8;\
  t1 |= input[(8*I)+5] & 0xff;   t1<<=8;\
  t1 |= input[(8*I)+6] & 0xff;   t1<<=8;\
  t1 |= input[(8*I)+7] & 0xff;\
  W[I] = t1;\
 }

#define Maj( x, y, z )   ((x & y) ^ (x & z) ^ (y & z))
 

#define e0( x )   (RORuns64(x,28) ^ RORuns64(x,34) ^ RORuns64(x,39))
 

#define e1( x )   (RORuns64(x,14) ^ RORuns64(x,18) ^ RORuns64(x,41))
 

#define s0( x )   (RORuns64(x,1) ^ RORuns64(x,8) ^ (x >> 7))
 

#define s1( x )   (RORuns64(x,19) ^ RORuns64(x,61) ^ (x >> 6))
 


Function Documentation

void sha512_xform ( uns64 * state,
const uns8 * input )
 



OpenSource