Fabcoin Core  0.16.2
P2P Digital Currency
Namespaces | Macros | Functions
Hash.cpp File Reference
#include "Hash.h"
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include "picosha2.h"
Include dependency graph for Hash.cpp:

Go to the source code of this file.

Namespaces

 dev
 Adapted from code found on http://stackoverflow.com/questions/180947/base64-decode-snippet-in-c Originally by RenĂ© Nyffenegger.
 
 dev::rmd160
 

Macros

#define RMDsize   160
 
#define BYTES_TO_DWORD(strptr)
 
#define ROL(x, n)   (((x) << (n)) | ((x) >> (32-(n))))
 
#define F(x, y, z)   ((x) ^ (y) ^ (z))
 
#define G(x, y, z)   (((x) & (y)) | (~(x) & (z)))
 
#define H(x, y, z)   (((x) | ~(y)) ^ (z))
 
#define I(x, y, z)   (((x) & (z)) | ((y) & ~(z)))
 
#define J(x, y, z)   ((x) ^ ((y) | ~(z)))
 
#define FF(a, b, c, d, e, x, s)
 
#define GG(a, b, c, d, e, x, s)
 
#define HH(a, b, c, d, e, x, s)
 
#define II(a, b, c, d, e, x, s)
 
#define JJ(a, b, c, d, e, x, s)
 
#define FFF(a, b, c, d, e, x, s)
 
#define GGG(a, b, c, d, e, x, s)
 
#define HHH(a, b, c, d, e, x, s)
 
#define III(a, b, c, d, e, x, s)
 
#define JJJ(a, b, c, d, e, x, s)
 

Functions

h256 dev::sha256 (bytesConstRef _input)
 
void dev::rmd160::MDinit (uint32_t *MDbuf)
 
void dev::rmd160::MDcompress (uint32_t *MDbuf, uint32_t *X)
 
void dev::rmd160::MDfinish (uint32_t *MDbuf, byte const *strptr, uint32_t lswlen, uint32_t mswlen)
 
h160 dev::ripemd160 (bytesConstRef _input)
 

Detailed Description

Author
Gav Wood i@gav.nosp@m.wood.nosp@m..com
Date
2014

Definition in file Hash.cpp.

Macro Definition Documentation

#define BYTES_TO_DWORD (   strptr)
Value:
(((uint32_t) *((strptr)+3) << 24) | \
((uint32_t) *((strptr)+2) << 16) | \
((uint32_t) *((strptr)+1) << 8) | \
((uint32_t) *(strptr)))

Definition at line 68 of file Hash.cpp.

#define F (   x,
  y,
  z 
)    ((x) ^ (y) ^ (z))

Definition at line 79 of file Hash.cpp.

#define FF (   a,
  b,
  c,
  d,
  e,
  x,
 
)
Value:
{\
(a) += F((b), (c), (d)) + (x);\
(a) = ROL((a), (s)) + (e);\
(c) = ROL((c), 10);\
}
#define ROL(x, n)
Definition: Hash.cpp:76
#define c(i)
#define a(i)
#define x(i)
#define F(x, y, z)
Definition: Hash.cpp:79
#define b(i, j)
#define e(i)
Definition: sha.cpp:733
#define d(i)
Definition: sha.cpp:732

Definition at line 86 of file Hash.cpp.

#define FFF (   a,
  b,
  c,
  d,
  e,
  x,
 
)
Value:
{\
(a) += F((b), (c), (d)) + (x);\
(a) = ROL((a), (s)) + (e);\
(c) = ROL((c), 10);\
}
#define ROL(x, n)
Definition: Hash.cpp:76
#define c(i)
#define a(i)
#define x(i)
#define F(x, y, z)
Definition: Hash.cpp:79
#define b(i, j)
#define e(i)
Definition: sha.cpp:733
#define d(i)
Definition: sha.cpp:732

Definition at line 111 of file Hash.cpp.

#define G (   x,
  y,
  z 
)    (((x) & (y)) | (~(x) & (z)))

Definition at line 80 of file Hash.cpp.

#define GG (   a,
  b,
  c,
  d,
  e,
  x,
 
)
Value:
{\
(a) += G((b), (c), (d)) + (x) + 0x5a827999UL;\
(a) = ROL((a), (s)) + (e);\
(c) = ROL((c), 10);\
}
#define ROL(x, n)
Definition: Hash.cpp:76
#define c(i)
#define a(i)
#define x(i)
#define b(i, j)
#define UL(i)
#define e(i)
Definition: sha.cpp:733
#define d(i)
Definition: sha.cpp:732
#define G(x, y, z)
Definition: Hash.cpp:80

Definition at line 91 of file Hash.cpp.

#define GGG (   a,
  b,
  c,
  d,
  e,
  x,
 
)
Value:
{\
(a) += G((b), (c), (d)) + (x) + 0x7a6d76e9UL;\
(a) = ROL((a), (s)) + (e);\
(c) = ROL((c), 10);\
}
#define ROL(x, n)
Definition: Hash.cpp:76
#define c(i)
#define a(i)
#define x(i)
#define b(i, j)
#define UL(i)
#define e(i)
Definition: sha.cpp:733
#define d(i)
Definition: sha.cpp:732
#define G(x, y, z)
Definition: Hash.cpp:80

Definition at line 116 of file Hash.cpp.

#define H (   x,
  y,
  z 
)    (((x) | ~(y)) ^ (z))

Definition at line 81 of file Hash.cpp.

#define HH (   a,
  b,
  c,
  d,
  e,
  x,
 
)
Value:
{\
(a) += H((b), (c), (d)) + (x) + 0x6ed9eba1UL;\
(a) = ROL((a), (s)) + (e);\
(c) = ROL((c), 10);\
}
#define ROL(x, n)
Definition: Hash.cpp:76
#define c(i)
#define a(i)
#define x(i)
#define H(x, y, z)
Definition: Hash.cpp:81
#define b(i, j)
#define UL(i)
#define e(i)
Definition: sha.cpp:733
#define d(i)
Definition: sha.cpp:732

Definition at line 96 of file Hash.cpp.

#define HHH (   a,
  b,
  c,
  d,
  e,
  x,
 
)
Value:
{\
(a) += H((b), (c), (d)) + (x) + 0x6d703ef3UL;\
(a) = ROL((a), (s)) + (e);\
(c) = ROL((c), 10);\
}
#define ROL(x, n)
Definition: Hash.cpp:76
#define c(i)
#define a(i)
#define x(i)
#define H(x, y, z)
Definition: Hash.cpp:81
#define b(i, j)
#define UL(i)
#define e(i)
Definition: sha.cpp:733
#define d(i)
Definition: sha.cpp:732

Definition at line 121 of file Hash.cpp.

#define I (   x,
  y,
  z 
)    (((x) & (z)) | ((y) & ~(z)))

Definition at line 82 of file Hash.cpp.

#define II (   a,
  b,
  c,
  d,
  e,
  x,
 
)
Value:
{\
(a) += I((b), (c), (d)) + (x) + 0x8f1bbcdcUL;\
(a) = ROL((a), (s)) + (e);\
(c) = ROL((c), 10);\
}
#define ROL(x, n)
Definition: Hash.cpp:76
#define c(i)
#define a(i)
#define x(i)
#define b(i, j)
#define UL(i)
#define I(x, y, z)
Definition: Hash.cpp:82
#define e(i)
Definition: sha.cpp:733
#define d(i)
Definition: sha.cpp:732

Definition at line 101 of file Hash.cpp.

#define III (   a,
  b,
  c,
  d,
  e,
  x,
 
)
Value:
{\
(a) += I((b), (c), (d)) + (x) + 0x5c4dd124UL;\
(a) = ROL((a), (s)) + (e);\
(c) = ROL((c), 10);\
}
#define ROL(x, n)
Definition: Hash.cpp:76
#define c(i)
#define a(i)
#define x(i)
#define b(i, j)
#define UL(i)
#define I(x, y, z)
Definition: Hash.cpp:82
#define e(i)
Definition: sha.cpp:733
#define d(i)
Definition: sha.cpp:732

Definition at line 126 of file Hash.cpp.

#define J (   x,
  y,
  z 
)    ((x) ^ ((y) | ~(z)))

Definition at line 83 of file Hash.cpp.

#define JJ (   a,
  b,
  c,
  d,
  e,
  x,
 
)
Value:
{\
(a) += J((b), (c), (d)) + (x) + 0xa953fd4eUL;\
(a) = ROL((a), (s)) + (e);\
(c) = ROL((c), 10);\
}
#define ROL(x, n)
Definition: Hash.cpp:76
#define c(i)
#define a(i)
#define x(i)
#define J(x, y, z)
Definition: Hash.cpp:83
#define b(i, j)
#define UL(i)
#define e(i)
Definition: sha.cpp:733
#define d(i)
Definition: sha.cpp:732

Definition at line 106 of file Hash.cpp.

#define JJJ (   a,
  b,
  c,
  d,
  e,
  x,
 
)
Value:
{\
(a) += J((b), (c), (d)) + (x) + 0x50a28be6UL;\
(a) = ROL((a), (s)) + (e);\
(c) = ROL((c), 10);\
}
#define ROL(x, n)
Definition: Hash.cpp:76
#define c(i)
#define a(i)
#define x(i)
#define J(x, y, z)
Definition: Hash.cpp:83
#define b(i, j)
#define UL(i)
#define e(i)
Definition: sha.cpp:733
#define d(i)
Definition: sha.cpp:732

Definition at line 131 of file Hash.cpp.

#define RMDsize   160

Definition at line 65 of file Hash.cpp.

#define ROL (   x,
 
)    (((x) << (n)) | ((x) >> (32-(n))))

Definition at line 76 of file Hash.cpp.