Botan
3.7.1
Crypto and TLS for C&
Toggle main menu visibility
Main Page
Related Pages
Topics
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
z
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
z
Variables
Typedefs
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
Enumerations
a
c
d
e
f
g
h
k
l
m
n
o
p
r
s
t
u
v
w
Enumerator
c
d
f
i
m
n
r
s
t
Concepts
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
f
h
i
m
n
o
p
r
s
t
u
v
w
Enumerations
b
c
d
e
k
m
n
o
p
s
t
x
Enumerator
_
a
b
c
d
e
f
h
k
l
m
n
p
q
r
s
t
u
w
x
Related Symbols
b
c
d
e
f
k
o
p
s
t
x
Files
File List
File Members
All
_
a
b
c
d
e
f
i
k
m
n
o
p
q
s
t
u
w
x
y
z
Functions
b
c
Variables
Typedefs
b
c
e
p
t
Enumerations
Enumerator
b
c
d
e
k
n
Macros
_
a
b
c
f
m
n
q
s
t
w
src
lib
hash
sha2_64
sha2_64_f.h
Go to the documentation of this file.
1
/*
2
* (C) 2023 Jack Lloyd
3
*
4
* Botan is released under the Simplified BSD License (see license.txt)
5
*/
6
7
#ifndef BOTAN_SHA2_64_F_H_
8
#define BOTAN_SHA2_64_F_H_
9
10
#include <botan/types.h>
11
#include <botan/internal/bit_ops.h>
12
#include <botan/internal/rotate.h>
13
14
namespace
Botan
{
15
16
/*
17
* SHA-512 F1 Function
18
*/
19
BOTAN_FORCE_INLINE
void
SHA2_64_F
(uint64_t A,
20
uint64_t B,
21
uint64_t C,
22
uint64_t& D,
23
uint64_t E,
24
uint64_t F,
25
uint64_t G,
26
uint64_t& H,
27
uint64_t& M1,
28
uint64_t M2,
29
uint64_t M3,
30
uint64_t M4,
31
uint64_t magic) {
32
const
uint64_t E_rho =
rho<14, 18, 41>
(E);
33
const
uint64_t A_rho =
rho<28, 34, 39>
(A);
34
const
uint64_t M2_sigma =
sigma<19, 61, 6>
(M2);
35
const
uint64_t M4_sigma =
sigma<1, 8, 7>
(M4);
36
H += magic + E_rho +
choose
(E, F, G) + M1;
37
D += H;
38
H += A_rho +
majority
(A, B, C);
39
M1 += M2_sigma + M3 + M4_sigma;
40
}
19
BOTAN_FORCE_INLINE
void
SHA2_64_F
(uint64_t A, {
…
}
41
42
}
// namespace Botan
43
44
#endif
BOTAN_FORCE_INLINE
#define BOTAN_FORCE_INLINE
Definition
compiler.h:71
Botan
Definition
alg_id.cpp:13
Botan::rho
constexpr T rho(T x)
Definition
rotate.h:51
Botan::sigma
constexpr T sigma(T x)
Definition
rotate.h:43
Botan::choose
constexpr T choose(T mask, T a, T b)
Definition
bit_ops.h:204
Botan::SHA2_64_F
BOTAN_FORCE_INLINE void SHA2_64_F(uint64_t A, uint64_t B, uint64_t C, uint64_t &D, uint64_t E, uint64_t F, uint64_t G, uint64_t &H, uint64_t &M1, uint64_t M2, uint64_t M3, uint64_t M4, uint64_t magic)
Definition
sha2_64_f.h:19
Botan::majority
constexpr T majority(T a, T b, T c)
Definition
bit_ops.h:210
Generated by
1.12.0