RTEMS CPU Kit with SuperCore  4.11.3
Macros | Functions
sha512c.c File Reference
#include <sys/cdefs.h>
#include <sys/endian.h>
#include <sys/types.h>
#include <string.h>
#include "sha512.h"
Include dependency graph for sha512c.c:

Macros

#define be64enc_vect(dst, src, len)   memcpy((void *)dst, (const void *)src, (size_t)len)
 
#define be64dec_vect(dst, src, len)   memcpy((void *)dst, (const void *)src, (size_t)len)
 
#define Ch(x, y, z)   ((x & (y ^ z)) ^ z)
 
#define Maj(x, y, z)   ((x & (y | z)) | (y & z))
 
#define SHR(x, n)   (x >> n)
 
#define ROTR(x, n)   ((x >> n) | (x << (64 - n)))
 
#define S0(x)   (ROTR(x, 28) ^ ROTR(x, 34) ^ ROTR(x, 39))
 
#define S1(x)   (ROTR(x, 14) ^ ROTR(x, 18) ^ ROTR(x, 41))
 
#define s0(x)   (ROTR(x, 1) ^ ROTR(x, 8) ^ SHR(x, 7))
 
#define s1(x)   (ROTR(x, 19) ^ ROTR(x, 61) ^ SHR(x, 6))
 
#define RND(a, b, c, d, e, f, g, h, k)
 
#define RNDr(S, W, i, k)
 

Functions

 __FBSDID ("$FreeBSD$")
 
void SHA512_Init (SHA512_CTX *ctx)
 
void SHA512_Update (SHA512_CTX *ctx, const void *in, size_t len)
 
void SHA512_Final (unsigned char digest[64], SHA512_CTX *ctx)
 

Macro Definition Documentation

◆ RND

#define RND (   a,
  b,
  c,
  d,
  e,
  f,
  g,
  h,
 
)
Value:
t0 = h + S1(e) + Ch(e, f, g) + k; \
t1 = S0(a) + Maj(a, b, c); \
d += t0; \
h = t0 + t1;

◆ RNDr

#define RNDr (   S,
  W,
  i,
 
)
Value:
RND(S[(80 - i) % 8], S[(81 - i) % 8], \
S[(82 - i) % 8], S[(83 - i) % 8], \
S[(84 - i) % 8], S[(85 - i) % 8], \
S[(86 - i) % 8], S[(87 - i) % 8], \
W[i] + k)