Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RSha256.hxx File Reference
#include "Rtypes.h"
#include <iostream>
#include <stdlib.h>
#include <stdint.h>
Include dependency graph for RSha256.hxx:
This graph shows which files directly or indirectly include this file:

Classes

struct  ROOT::Internal::SHA256::sha256_t
 

Namespaces

namespace  ROOT
 This file contains a specialised ROOT message handler to test for diagnostic in unit tests.
 
namespace  ROOT::Internal
 
namespace  ROOT::Internal::SHA256
 

Macros

#define _SHA256_UNROLL
 
#define _SHA256_UNROLL2
 
#define a(i)   T[(0 - (i)) & 7]
 
#define b(i)   T[(1 - (i)) & 7]
 
#define blk0(i)   (W[i] = data[i])
 
#define blk2(i)   (W[i & 15] += s1(W[(i - 2) & 15]) + W[(i - 7) & 15] + s0(W[(i - 15) & 15]))
 
#define c(i)   T[(2 - (i)) & 7]
 
#define Ch(x, y, z)   (z ^ (x & (y ^ z)))
 
#define d(i)   T[(3 - (i)) & 7]
 
#define e(i)   T[(4 - (i)) & 7]
 
#define f(i)   T[(5 - (i)) & 7]
 
#define g(i)   T[(6 - (i)) & 7]
 
#define h(i)   T[(7 - (i)) & 7]
 
#define Maj(x, y, z)   ((x & y) | (z & (x | y)))
 
#define R(a, b, c, d, e, f, g, h, i)
 
#define ROTL16(v, n)   (U16V((uint16_t)(v) << (n)) | ((uint16_t)(v) >> (16 - (n))))
 
#define ROTL32(v, n)   (U32V((uint32_t)(v) << (n)) | ((uint32_t)(v) >> (32 - (n))))
 
#define ROTL64(v, n)   (U64V((uint64_t)(v) << (n)) | ((uint64_t)(v) >> (64 - (n))))
 
#define ROTL8(v, n)   (U8V((uint8_t)(v) << (n)) | ((uint8_t)(v) >> (8 - (n))))
 
#define ROTR16(v, n)   ROTL16(v, 16 - (n))
 
#define ROTR32(v, n)   ROTL32(v, 32 - (n))
 
#define ROTR64(v, n)   ROTL64(v, 64 - (n))
 
#define ROTR8(v, n)   ROTL8(v, 8 - (n))
 
#define RX_8(i)
 
#define S0(x)   (ROTR32(x, 2) ^ ROTR32(x, 13) ^ ROTR32(x, 22))
 
#define s0(x)   (ROTR32(x, 7) ^ ROTR32(x, 18) ^ (x >> 3))
 
#define S1(x)   (ROTR32(x, 6) ^ ROTR32(x, 11) ^ ROTR32(x, 25))
 
#define s1(x)   (ROTR32(x, 17) ^ ROTR32(x, 19) ^ (x >> 10))
 
#define SHA256_DIGEST_SIZE   32
 
#define U16V(v)   ((uint16_t)(v)&0xFFFFU)
 
#define U32V(v)   ((uint32_t)(v)&0xFFFFFFFFU)
 
#define U64V(v)   ((uint64_t)(v)&0xFFFFFFFFFFFFFFFFU)
 
#define U8V(v)   ((uint8_t)(v)&0xFFU)
 

Typedefs

typedef struct ROOT::Internal::SHA256::sha256_t ROOT::Internal::SHA256::sha256_t
 

Functions

void ROOT::Internal::Sha256 (const unsigned char *data, int len, ULong64_t *fDigest)
 
void ROOT::Internal::SHA256::sha256_final (sha256_t *p, unsigned char *digest)
 
void ROOT::Internal::SHA256::sha256_hash (unsigned char *buf, const unsigned char *data, size_t size)
 
void ROOT::Internal::SHA256::sha256_init (sha256_t *p)
 
static void ROOT::Internal::SHA256::sha256_transform (uint32_t *state, const uint32_t *data)
 
void ROOT::Internal::SHA256::sha256_update (sha256_t *p, const unsigned char *data, size_t size)
 
static void ROOT::Internal::SHA256::sha256_write_byte_block (sha256_t *p)
 

Variables

static const uint32_t ROOT::Internal::SHA256::K [64]
 

Macro Definition Documentation

◆ _SHA256_UNROLL

#define _SHA256_UNROLL

Definition at line 72 of file RSha256.hxx.

◆ _SHA256_UNROLL2

#define _SHA256_UNROLL2

Definition at line 73 of file RSha256.hxx.

◆ a

#define a (   i)    T[(0 - (i)) & 7]

Definition at line 99 of file RSha256.hxx.

◆ b

#define b (   i)    T[(1 - (i)) & 7]

Definition at line 100 of file RSha256.hxx.

◆ blk0

#define blk0 (   i)    (W[i] = data[i])

Definition at line 93 of file RSha256.hxx.

◆ blk2

#define blk2 (   i)    (W[i & 15] += s1(W[(i - 2) & 15]) + W[(i - 7) & 15] + s0(W[(i - 15) & 15]))

Definition at line 94 of file RSha256.hxx.

◆ c

#define c (   i)    T[(2 - (i)) & 7]

Definition at line 101 of file RSha256.hxx.

◆ Ch

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

Definition at line 96 of file RSha256.hxx.

◆ d

#define d (   i)    T[(3 - (i)) & 7]

Definition at line 102 of file RSha256.hxx.

◆ e

#define e (   i)    T[(4 - (i)) & 7]

Definition at line 103 of file RSha256.hxx.

◆ f

#define f (   i)    T[(5 - (i)) & 7]

Definition at line 104 of file RSha256.hxx.

◆ g

#define g (   i)    T[(6 - (i)) & 7]

Definition at line 105 of file RSha256.hxx.

◆ h

#define h (   i)    T[(7 - (i)) & 7]

Definition at line 106 of file RSha256.hxx.

◆ Maj

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

Definition at line 97 of file RSha256.hxx.

◆ R

#define R (   a,
  b,
  c,
  d,
  e,
  f,
  g,
  h,
 
)
Value:
h += S1(e) + Ch(e, f, g) + K[i + j] + (j ? blk2(i) : blk0(i)); \
d += h; \
h += S0(a) + Maj(a, b, c)
#define blk0(i)
Definition RSha256.hxx:93
#define d(i)
Definition RSha256.hxx:102
#define b(i)
Definition RSha256.hxx:100
#define f(i)
Definition RSha256.hxx:104
#define Maj(x, y, z)
Definition RSha256.hxx:97
#define S0(x)
Definition RSha256.hxx:88
#define S1(x)
Definition RSha256.hxx:89
#define c(i)
Definition RSha256.hxx:101
#define g(i)
Definition RSha256.hxx:105
#define a(i)
Definition RSha256.hxx:99
#define Ch(x, y, z)
Definition RSha256.hxx:96
#define h(i)
Definition RSha256.hxx:106
#define blk2(i)
Definition RSha256.hxx:94
#define e(i)
Definition RSha256.hxx:103

Definition at line 110 of file RSha256.hxx.

◆ ROTL16

#define ROTL16 (   v,
  n 
)    (U16V((uint16_t)(v) << (n)) | ((uint16_t)(v) >> (16 - (n))))

Definition at line 53 of file RSha256.hxx.

◆ ROTL32

#define ROTL32 (   v,
  n 
)    (U32V((uint32_t)(v) << (n)) | ((uint32_t)(v) >> (32 - (n))))

Definition at line 41 of file RSha256.hxx.

◆ ROTL64

#define ROTL64 (   v,
  n 
)    (U64V((uint64_t)(v) << (n)) | ((uint64_t)(v) >> (64 - (n))))

Definition at line 44 of file RSha256.hxx.

◆ ROTL8

#define ROTL8 (   v,
  n 
)    (U8V((uint8_t)(v) << (n)) | ((uint8_t)(v) >> (8 - (n))))

Definition at line 51 of file RSha256.hxx.

◆ ROTR16

#define ROTR16 (   v,
  n 
)    ROTL16(v, 16 - (n))

Definition at line 56 of file RSha256.hxx.

◆ ROTR32

#define ROTR32 (   v,
  n 
)    ROTL32(v, 32 - (n))

Definition at line 46 of file RSha256.hxx.

◆ ROTR64

#define ROTR64 (   v,
  n 
)    ROTL64(v, 64 - (n))

Definition at line 47 of file RSha256.hxx.

◆ ROTR8

#define ROTR8 (   v,
  n 
)    ROTL8(v, 8 - (n))

Definition at line 55 of file RSha256.hxx.

◆ RX_8

#define RX_8 (   i)
Value:
R(a, b, c, d, e, f, g, h, i); \
R(h, a, b, c, d, e, f, g, (i + 1)); \
R(g, h, a, b, c, d, e, f, (i + 2)); \
R(f, g, h, a, b, c, d, e, (i + 3)); \
R(e, f, g, h, a, b, c, d, (i + 4)); \
R(d, e, f, g, h, a, b, c, (i + 5)); \
R(c, d, e, f, g, h, a, b, (i + 6)); \
R(b, c, d, e, f, g, h, a, (i + 7))
#define R(a, b, c, d, e, f, g, h, i)
Definition RSha256.hxx:110

Definition at line 115 of file RSha256.hxx.

◆ S0

#define S0 (   x)    (ROTR32(x, 2) ^ ROTR32(x, 13) ^ ROTR32(x, 22))

Definition at line 88 of file RSha256.hxx.

◆ s0

#define s0 (   x)    (ROTR32(x, 7) ^ ROTR32(x, 18) ^ (x >> 3))

Definition at line 90 of file RSha256.hxx.

◆ S1

#define S1 (   x)    (ROTR32(x, 6) ^ ROTR32(x, 11) ^ ROTR32(x, 25))

Definition at line 89 of file RSha256.hxx.

◆ s1

#define s1 (   x)    (ROTR32(x, 17) ^ ROTR32(x, 19) ^ (x >> 10))

Definition at line 91 of file RSha256.hxx.

◆ SHA256_DIGEST_SIZE

#define SHA256_DIGEST_SIZE   32

Definition at line 58 of file RSha256.hxx.

◆ U16V

#define U16V (   v)    ((uint16_t)(v)&0xFFFFU)

Definition at line 37 of file RSha256.hxx.

◆ U32V

#define U32V (   v)    ((uint32_t)(v)&0xFFFFFFFFU)

Definition at line 38 of file RSha256.hxx.

◆ U64V

#define U64V (   v)    ((uint64_t)(v)&0xFFFFFFFFFFFFFFFFU)

Definition at line 39 of file RSha256.hxx.

◆ U8V

#define U8V (   v)    ((uint8_t)(v)&0xFFU)

Definition at line 36 of file RSha256.hxx.