Internal implementation of the Subterranean block operation.
More...
#include "internal-util.h"
Go to the source code of this file.
Internal implementation of the Subterranean block operation.
References: https://cs.ru.nl/~joan/subterranean.html
#define subterranean_duplex_0 |
( |
|
state | ) |
|
Value:
(state)->x[0] ^= 2; \
} while (0)
void subterranean_round(subterranean_state_t *state)
Performs a single Subterranean round.
Definition: internal-subterranean.c:28
Performs a single Subterranean round and absorbs 0 bytes.
- Parameters
-
state | Subterranean state to be transformed. |
#define subterranean_duplex_1 |
( |
|
state, |
|
|
|
data |
|
) |
| |
Value:
} while (0)
void subterranean_absorb_1(subterranean_state_t *state, unsigned char data)
Absorbs a single byte into the Subterranean state.
Definition: internal-subterranean.c:173
void subterranean_round(subterranean_state_t *state)
Performs a single Subterranean round.
Definition: internal-subterranean.c:28
Performs a single Subterranean round and absorbs one byte.
- Parameters
-
state | Subterranean state to be transformed. |
data | The single byte to be absorbed. |
#define subterranean_duplex_4 |
( |
|
state, |
|
|
|
data |
|
) |
| |
Value:
(state)->x[8] ^= 1; \
} while (0)
#define subterranean_duplex_word(state, x)
Absorbs a 32-bit word into the Subterranean state after performing the round function.
Definition: internal-subterranean.h:112
Performs a single Subterranean round and absorbs four bytes.
- Parameters
-
state | Subterranean state to be transformed. |
data | 32-bit word containing the four data bytes to be absorbed. |
#define subterranean_duplex_word |
( |
|
state, |
|
|
|
x |
|
) |
| |
Value:
} while (0)
void subterranean_absorb_word(subterranean_state_t *state, uint32_t x)
Absorbs a 32-bit word into the Subterranean state.
Definition: internal-subterranean.c:187
void subterranean_round(subterranean_state_t *state)
Performs a single Subterranean round.
Definition: internal-subterranean.c:28
Absorbs a 32-bit word into the Subterranean state after performing the round function.
- Parameters
-
state | Subterranean state to be transformed. |
x | The word to absorb into the state. |
void subterranean_absorb |
( |
subterranean_state_t * |
state, |
|
|
const unsigned char * |
data, |
|
|
unsigned long long |
len |
|
) |
| |
Absorbs an arbitrary amount of data, four bytes at a time.
- Parameters
-
state | Subterranean state to be transformed. |
data | Points to the bytes to be absorbed. |
len | Number of bytes to absorb. |
Absorbs a single byte into the Subterranean state.
- Parameters
-
state | Subterranean state to be transformed. |
data | The single byte to be absorbed. |
Absorbs a 32-bit word into the Subterranean state.
- Parameters
-
state | Subterranean state to be transformed. |
x | The word to absorb into the state. |
Performs 8 Subterranean rounds with no absorption or squeezing of data; i.e. data input and output is "blanked".
- Parameters
-
state | Subterranean state to be transformed. |
void subterranean_duplex_n |
( |
subterranean_state_t * |
state, |
|
|
const unsigned char * |
data, |
|
|
unsigned |
len |
|
) |
| |
Performs a single Subterranean round and absorbs between zero and four bytes.
- Parameters
-
state | Subterranean state to be transformed. |
data | Points to the data bytes to be absorbed. |
len | Length of the data to be absorbed. |
Extracts 32 bits of output from the Subterranean state.
- Parameters
-
state | Subterranean state to extract the output from. |
- Returns
- Returns the 32-bit word that was extracted.
Performs a single Subterranean round.
- Parameters
-
state | Subterranean state to be transformed. |
Squeezes an arbitrary amount of data out of a Subterranean state.
- Parameters
-
state | Subterranean state to extract the output from. |
data | Points to the data buffer to receive the output. |
len | Number of bytes to be extracted. |