FARGOS/VISTA Object Management Environment Core  ..
FARGOS/VISTA Object Management Environment Core Table of Contents
sha256.cpp File Reference
#include <stdio.h>
#include <OMEstring.h>
#include <iostream>

Macros

#define HIDE_FUNCTION   static
 
#define Ch(x, y, z)   ((x & y) ^ (~x & z))
 
#define Maj(x, y, z)   ((x & y) ^ (x & z) ^ (y & z))
 
#define S(x, n)   (((x)>>((n)&31))|((x)<<(32-((n)&31))))
 
#define R(x, n)   ((x)>>(n))
 
#define Sigma0(x)   (S(x, 2) ^ S(x, 13) ^ S(x, 22))
 
#define Sigma1(x)   (S(x, 6) ^ S(x, 11) ^ S(x, 25))
 
#define Gamma0(x)   (S(x, 7) ^ S(x, 18) ^ R(x, 3))
 
#define Gamma1(x)   (S(x, 17) ^ S(x, 19) ^ R(x, 10))
 

Functions

HIDE_FUNCTION void sha_init (sha_state *md)
 
HIDE_FUNCTION void sha_process (sha_state *md, const unsigned char *buf, size_t len)
 
HIDE_FUNCTION void sha_done (sha_state *md, unsigned char hash[32])
 
HIDE_FUNCTION void sha_memory (const unsigned char *buf, size_t len, unsigned char hash[32])
 
OMEstringOMEmakeSHA256hash (const OMEstring &message)
 Compute Secure Hash Algorithm 256 over an OMEstring. More...
 

Macro Definition Documentation

◆ Ch

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

◆ Gamma0

#define Gamma0 (   x)    (S(x, 7) ^ S(x, 18) ^ R(x, 3))

◆ Gamma1

#define Gamma1 (   x)    (S(x, 17) ^ S(x, 19) ^ R(x, 10))

◆ HIDE_FUNCTION

#define HIDE_FUNCTION   static

◆ Maj

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

◆ R

#define R (   x,
 
)    ((x)>>(n))

◆ S

#define S (   x,
 
)    (((x)>>((n)&31))|((x)<<(32-((n)&31))))

◆ Sigma0

#define Sigma0 (   x)    (S(x, 2) ^ S(x, 13) ^ S(x, 22))

◆ Sigma1

#define Sigma1 (   x)    (S(x, 6) ^ S(x, 11) ^ S(x, 25))

Function Documentation

◆ sha_done()

HIDE_FUNCTION void sha_done ( sha_state *  md,
unsigned char  hash[32] 
)

Referenced by sha_memory().

◆ sha_init()

HIDE_FUNCTION void sha_init ( sha_state *  md)

Referenced by sha_memory().

◆ sha_memory()

HIDE_FUNCTION void sha_memory ( const unsigned char *  buf,
size_t  len,
unsigned char  hash[32] 
)
inline

References sha_done(), sha_init(), and sha_process().

Referenced by OMEmakeSHA256hash().

◆ sha_process()

HIDE_FUNCTION void sha_process ( sha_state *  md,
const unsigned char *  buf,
size_t  len 
)

Referenced by sha_memory().

Generated: Fri Jul 31 2020 18:19:16
Support Information