Project Alice
Loading...
Searching...
No Matches
SHA512.hpp File Reference

Header file describing the function signatures and the constants of the SHA512 Algorithm. More...

#include <string>
#include <stdio.h>
#include <string.h>
#include <iostream>
#include <iomanip>
#include <cstdint>
#include <sstream>
Include dependency graph for SHA512.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  network::SHA512
 

Namespaces

namespace  network
 

Macros

#define Ch(x, y, z)   ((x&y)^(~x&z))
 
#define Maj(x, y, z)   ((x&y)^(x&z)^(y&z))
 
#define RotR(x, n)   ((x>>n)|(x<<((sizeof(x)<<3)-n)))
 
#define Sig0(x)   ((RotR(x, 28))^(RotR(x,34))^(RotR(x, 39)))
 
#define Sig1(x)   ((RotR(x, 14))^(RotR(x,18))^(RotR(x, 41)))
 
#define sig0(x)   (RotR(x, 1)^RotR(x,8)^(x>>7))
 
#define sig1(x)   (RotR(x, 19)^RotR(x,61)^(x>>6))
 

Typedefs

typedef unsigned long long network::uint64
 

Variables

unsigned int const network::SEQUENCE_LEN = (1024 / 64)
 
size_t const network::HASH_LEN = 8
 
size_t const network::WORKING_VAR_LEN = 8
 
size_t const network::MESSAGE_SCHEDULE_LEN = 80
 
size_t const network::MESSAGE_BLOCK_SIZE = 1024
 
size_t const network::CHAR_LEN_BITS = 8
 
size_t const network::OUTPUT_LEN = 8
 
size_t const network::WORD_LEN = 8
 

Detailed Description

Header file describing the function signatures and the constants of the SHA512 Algorithm.

C++ implementation of the SHA512, SHA384 and SHA256 hashing algorithms.

From: https://github.com/pr0f3ss/SHA

Copyright (c) 2022 Filip Dobrosavljevic

MIT license

Definition in file SHA512.hpp.

Macro Definition Documentation

◆ Ch

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

Definition at line 77 of file SHA512.hpp.

◆ Maj

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

Definition at line 78 of file SHA512.hpp.

◆ RotR

#define RotR (   x,
 
)    ((x>>n)|(x<<((sizeof(x)<<3)-n)))

Definition at line 79 of file SHA512.hpp.

◆ Sig0

#define Sig0 (   x)    ((RotR(x, 28))^(RotR(x,34))^(RotR(x, 39)))

Definition at line 80 of file SHA512.hpp.

◆ sig0

#define sig0 (   x)    (RotR(x, 1)^RotR(x,8)^(x>>7))

Definition at line 82 of file SHA512.hpp.

◆ Sig1

#define Sig1 (   x)    ((RotR(x, 14))^(RotR(x,18))^(RotR(x, 41)))

Definition at line 81 of file SHA512.hpp.

◆ sig1

#define sig1 (   x)    (RotR(x, 19)^RotR(x,61)^(x>>6))

Definition at line 83 of file SHA512.hpp.