#include <stddef.h>
#include <string.h>
#include <limits.h>
#include "sph_blake.h"
Go to the source code of this file.
|
| void | sph_blake224_init (void *cc) |
| | Initialize a BLAKE-224 context. More...
|
| |
| void | sph_blake224 (void *cc, const void *data, size_t len) |
| | Process some data bytes. More...
|
| |
| void | sph_blake224_close (void *cc, void *dst) |
| | Terminate the current BLAKE-224 computation and output the result into the provided buffer. More...
|
| |
| void | sph_blake224_addbits_and_close (void *cc, unsigned ub, unsigned n, void *dst) |
| | Add a few additional bits (0 to 7) to the current computation, then terminate it and output the result in the provided buffer, which must be wide enough to accomodate the result (28 bytes). More...
|
| |
| void | sph_blake256_init (void *cc) |
| | Initialize a BLAKE-256 context. More...
|
| |
| void | sph_blake256 (void *cc, const void *data, size_t len) |
| | Process some data bytes. More...
|
| |
| void | sph_blake256_close (void *cc, void *dst) |
| | Terminate the current BLAKE-256 computation and output the result into the provided buffer. More...
|
| |
| void | sph_blake256_addbits_and_close (void *cc, unsigned ub, unsigned n, void *dst) |
| | Add a few additional bits (0 to 7) to the current computation, then terminate it and output the result in the provided buffer, which must be wide enough to accomodate the result (32 bytes). More...
|
| |
◆ COMPRESS32
◆ CS0
◆ CS1
◆ CS2
◆ CS3
◆ CS4
◆ CS5
◆ CS6
◆ CS7
◆ CS8
◆ CS9
◆ CSA
◆ CSB
◆ CSC
◆ CSD
◆ CSE
◆ CSF
◆ CSx
| #define CSx |
( |
|
r, |
|
|
|
i |
|
) |
| CSx_(Z ## r ## i) |
◆ CSx_
| #define CSx_ |
( |
|
n | ) |
CSx__(n) |
◆ CSx__
| #define CSx__ |
( |
|
n | ) |
CS ## n |
◆ DECL_STATE32
Value: sph_u32 H0, H1, H2, H3, H4, H5, H6, H7; \
sph_u32 S0, S1, S2, S3, T0, T1;
Definition at line 474 of file blake.c.
◆ GS
| #define GS |
( |
|
m0, |
|
|
|
m1, |
|
|
|
c0, |
|
|
|
c1, |
|
|
|
a, |
|
|
|
b, |
|
|
|
c, |
|
|
|
d |
|
) |
| |
◆ Mx
| #define Mx |
( |
|
r, |
|
|
|
i |
|
) |
| Mx_(Z ## r ## i) |
◆ Mx_
◆ Mx__
◆ READ_STATE32
| #define READ_STATE32 |
( |
|
state | ) |
|
Value: do { \
T0 = (state)->T0; \
T1 = (state)->T1; \
} while (0)
#define S(x0, x1, x2, x3, cb, r)
Definition at line 478 of file blake.c.
◆ ROUND_S
Value: do { \
GS(
Mx(r, 0),
Mx(r, 1),
CSx(r, 0),
CSx(r, 1), V0, V4, V8, VC); \
GS(
Mx(r, 2),
Mx(r, 3),
CSx(r, 2),
CSx(r, 3), V1, V5, V9, VD); \
GS(
Mx(r, 4),
Mx(r, 5),
CSx(r, 4),
CSx(r, 5), V2, V6, VA, VE); \
GS(
Mx(r, 6),
Mx(r, 7),
CSx(r, 6),
CSx(r, 7), V3, V7, VB, VF); \
GS(
Mx(r, 8),
Mx(r, 9),
CSx(r, 8),
CSx(r, 9), V0, V5, VA, VF); \
GS(
Mx(r, A),
Mx(r,
B),
CSx(r, A),
CSx(r,
B), V1, V6, VB, VC); \
GS(
Mx(r, C),
Mx(r, D),
CSx(r, C),
CSx(r, D), V2, V7, V8, VD); \
GS(
Mx(r,
E),
Mx(r, F),
CSx(r,
E),
CSx(r, F), V3, V4, V9, VE); \
} while (0)
Definition at line 410 of file blake.c.
◆ WRITE_STATE32
| #define WRITE_STATE32 |
( |
|
state | ) |
|
Value: do { \
(state)->T0 = T0; \
(state)->T1 = T1; \
} while (0)
Definition at line 495 of file blake.c.
◆ Z00
◆ Z01
◆ Z02
◆ Z03
◆ Z04
◆ Z05
◆ Z06
◆ Z07
◆ Z08
◆ Z09
◆ Z0A
◆ Z0B
◆ Z0C
◆ Z0D
◆ Z0E
◆ Z0F
◆ Z10
◆ Z11
◆ Z12
◆ Z13
◆ Z14
◆ Z15
◆ Z16
◆ Z17
◆ Z18
◆ Z19
◆ Z1A
◆ Z1B
◆ Z1C
◆ Z1D
◆ Z1E
◆ Z1F
◆ Z20
◆ Z21
◆ Z22
◆ Z23
◆ Z24
◆ Z25
◆ Z26
◆ Z27
◆ Z28
◆ Z29
◆ Z2A
◆ Z2B
◆ Z2C
◆ Z2D
◆ Z2E
◆ Z2F
◆ Z30
◆ Z31
◆ Z32
◆ Z33
◆ Z34
◆ Z35
◆ Z36
◆ Z37
◆ Z38
◆ Z39
◆ Z3A
◆ Z3B
◆ Z3C
◆ Z3D
◆ Z3E
◆ Z3F
◆ Z40
◆ Z41
◆ Z42
◆ Z43
◆ Z44
◆ Z45
◆ Z46
◆ Z47
◆ Z48
◆ Z49
◆ Z4A
◆ Z4B
◆ Z4C
◆ Z4D
◆ Z4E
◆ Z4F
◆ Z50
◆ Z51
◆ Z52
◆ Z53
◆ Z54
◆ Z55
◆ Z56
◆ Z57
◆ Z58
◆ Z59
◆ Z5A
◆ Z5B
◆ Z5C
◆ Z5D
◆ Z5E
◆ Z5F
◆ Z60
◆ Z61
◆ Z62
◆ Z63
◆ Z64
◆ Z65
◆ Z66
◆ Z67
◆ Z68
◆ Z69
◆ Z6A
◆ Z6B
◆ Z6C
◆ Z6D
◆ Z6E
◆ Z6F
◆ Z70
◆ Z71
◆ Z72
◆ Z73
◆ Z74
◆ Z75
◆ Z76
◆ Z77
◆ Z78
◆ Z79
◆ Z7A
◆ Z7B
◆ Z7C
◆ Z7D
◆ Z7E
◆ Z7F
◆ Z80
◆ Z81
◆ Z82
◆ Z83
◆ Z84
◆ Z85
◆ Z86
◆ Z87
◆ Z88
◆ Z89
◆ Z8A
◆ Z8B
◆ Z8C
◆ Z8D
◆ Z8E
◆ Z8F
◆ Z90
◆ Z91
◆ Z92
◆ Z93
◆ Z94
◆ Z95
◆ Z96
◆ Z97
◆ Z98
◆ Z99
◆ Z9A
◆ Z9B
◆ Z9C
◆ Z9D
◆ Z9E
◆ Z9F
◆ sph_blake224()
| void sph_blake224 |
( |
void * |
cc, |
|
|
const void * |
data, |
|
|
size_t |
len |
|
) |
| |
Process some data bytes.
It is acceptable that len is zero (in which case this function does nothing).
- Parameters
-
| cc | the BLAKE-224 context |
| data | the input data |
| len | the input data length (in bytes) |
Definition at line 1007 of file blake.c.
◆ sph_blake224_addbits_and_close()
| void sph_blake224_addbits_and_close |
( |
void * |
cc, |
|
|
unsigned |
ub, |
|
|
unsigned |
n, |
|
|
void * |
dst |
|
) |
| |
Add a few additional bits (0 to 7) to the current computation, then terminate it and output the result in the provided buffer, which must be wide enough to accomodate the result (28 bytes).
If bit number i in ub has value 2^i, then the extra bits are those numbered 7 downto 8-n (this is the big-endian convention at the byte level). The context is automatically reinitialized.
- Parameters
-
| cc | the BLAKE-224 context |
| ub | the extra bits |
| n | the number of extra bits (0 to 7) |
| dst | the destination buffer |
Definition at line 1021 of file blake.c.
◆ sph_blake224_close()
| void sph_blake224_close |
( |
void * |
cc, |
|
|
void * |
dst |
|
) |
| |
Terminate the current BLAKE-224 computation and output the result into the provided buffer.
The destination buffer must be wide enough to accomodate the result (28 bytes). The context is automatically reinitialized.
- Parameters
-
| cc | the BLAKE-224 context |
| dst | the destination buffer |
Definition at line 1014 of file blake.c.
◆ sph_blake224_init()
| void sph_blake224_init |
( |
void * |
cc | ) |
|
Initialize a BLAKE-224 context.
This process performs no memory allocation.
- Parameters
-
| cc | the BLAKE-224 context (pointer to a sph_blake224_context) |
Definition at line 1000 of file blake.c.
◆ sph_blake256()
| void sph_blake256 |
( |
void * |
cc, |
|
|
const void * |
data, |
|
|
size_t |
len |
|
) |
| |
Process some data bytes.
It is acceptable that len is zero (in which case this function does nothing).
- Parameters
-
| cc | the BLAKE-256 context |
| data | the input data |
| len | the input data length (in bytes) |
Definition at line 1036 of file blake.c.
◆ sph_blake256_addbits_and_close()
| void sph_blake256_addbits_and_close |
( |
void * |
cc, |
|
|
unsigned |
ub, |
|
|
unsigned |
n, |
|
|
void * |
dst |
|
) |
| |
Add a few additional bits (0 to 7) to the current computation, then terminate it and output the result in the provided buffer, which must be wide enough to accomodate the result (32 bytes).
If bit number i in ub has value 2^i, then the extra bits are those numbered 7 downto 8-n (this is the big-endian convention at the byte level). The context is automatically reinitialized.
- Parameters
-
| cc | the BLAKE-256 context |
| ub | the extra bits |
| n | the number of extra bits (0 to 7) |
| dst | the destination buffer |
Definition at line 1050 of file blake.c.
◆ sph_blake256_close()
| void sph_blake256_close |
( |
void * |
cc, |
|
|
void * |
dst |
|
) |
| |
Terminate the current BLAKE-256 computation and output the result into the provided buffer.
The destination buffer must be wide enough to accomodate the result (32 bytes). The context is automatically reinitialized.
- Parameters
-
| cc | the BLAKE-256 context |
| dst | the destination buffer |
Definition at line 1043 of file blake.c.
◆ sph_blake256_init()
| void sph_blake256_init |
( |
void * |
cc | ) |
|
Initialize a BLAKE-256 context.
This process performs no memory allocation.
- Parameters
-
| cc | the BLAKE-256 context (pointer to a sph_blake256_context) |
Definition at line 1029 of file blake.c.