Serialbox  2.2.0
Data serialization library and tools for C/C++, Python and Fortran
SHA256.cpp File Reference
#include "serialbox/core/hash/SHA256.h"
#include <cstdlib>
#include <cstring>
#include <sstream>

Go to the source code of this file.

Namespaces

 serialbox
 Namespace of the serialbox library.
 

Macros

#define ROTLEFT(a, b)   (((a) << (b)) | ((a) >> (32 - (b))))
 
#define ROTRIGHT(a, b)   (((a) >> (b)) | ((a) << (32 - (b))))
 
#define CH(x, y, z)   (((x) & (y)) ^ (~(x) & (z)))
 
#define MAJ(x, y, z)   (((x) & (y)) ^ ((x) & (z)) ^ ((y) & (z)))
 
#define EP0(x)   (ROTRIGHT(x, 2) ^ ROTRIGHT(x, 13) ^ ROTRIGHT(x, 22))
 
#define EP1(x)   (ROTRIGHT(x, 6) ^ ROTRIGHT(x, 11) ^ ROTRIGHT(x, 25))
 
#define SIG0(x)   (ROTRIGHT(x, 7) ^ ROTRIGHT(x, 18) ^ ((x) >> 3))
 
#define SIG1(x)   (ROTRIGHT(x, 17) ^ ROTRIGHT(x, 19) ^ ((x) >> 10))
 

Detailed Description

Implementation of the SHA-1 cryptographic hash function.

License

Author: Brad Conte (brad AT bradconte.com) Disclaimer: This code is presented "as is" without any guarantees. Details: Defines the API for the corresponding SHA1 implementation.

Definition in file SHA256.cpp.