|
cryptnox-pos 1.0.0
Standalone USDC payment terminal firmware (ESP32 + Cryptnox smart card)
|
Original (pre-NIST) Keccak-256 implementation, 0x01 padding. More...
Go to the source code of this file.
Macros | |
| #define | KECCAK_ROUNDS 24U |
| #define | KECCAK_RATE 136U /* 1088 / 8 bytes — rate for 256-bit output */ |
| #define | KECCAK_STATE_LANE 25U /* 5×5 uint64_t lanes */ |
Functions | |
| static uint64_t | rot64 (uint64_t x, uint8_t n) |
Rotate a 64-bit lane left by n bits. | |
| static void | keccak_f1600 (uint64_t st[KECCAK_STATE_LANE]) |
| Apply the full 24-round Keccak-f[1600] permutation in place. | |
| void | keccak256 (const uint8_t *input, size_t length, uint8_t digest[32]) |
| Compute the Keccak-256 digest of a buffer. | |
Variables | |
| static const uint64_t | kRC [KECCAK_ROUNDS] |
| static const uint8_t | kRHO [KECCAK_STATE_LANE] |
Original (pre-NIST) Keccak-256 implementation, 0x01 padding.
Definition in file keccak256.cpp.
| #define KECCAK_RATE 136U /* 1088 / 8 bytes — rate for 256-bit output */ |
Definition at line 25 of file keccak256.cpp.
Referenced by keccak256().
| #define KECCAK_ROUNDS 24U |
Definition at line 24 of file keccak256.cpp.
Referenced by keccak_f1600().
| #define KECCAK_STATE_LANE 25U /* 5×5 uint64_t lanes */ |
Definition at line 26 of file keccak256.cpp.
Referenced by keccak256(), and keccak_f1600().
| void keccak256 | ( | const uint8_t * | input, |
| size_t | length, | ||
| uint8_t | digest[32] ) |
Compute the Keccak-256 digest of a buffer.
Ethereum uses the original Keccak-256 (0x01 padding), NOT the NIST-finalised SHA3-256 (0x06 padding).
| [in] | input | Input bytes (may be NULL only if length is 0). |
| [in] | length | Number of input bytes. |
| [out] | digest | 32-byte output digest. |
Definition at line 120 of file keccak256.cpp.
References keccak_f1600(), KECCAK_RATE, and KECCAK_STATE_LANE.
Referenced by admin_derive(), card_read_payouts(), eth_addr_format(), eth_addr_parse(), and sign_and_broadcast().
|
static |
Apply the full 24-round Keccak-f[1600] permutation in place.
| [in,out] | st | 5x5 lane state, modified in place. |
Definition at line 73 of file keccak256.cpp.
References KECCAK_ROUNDS, KECCAK_STATE_LANE, kRC, kRHO, and rot64().
Referenced by keccak256().
|
static |
Rotate a 64-bit lane left by n bits.
| [in] | x | Lane value. |
| [in] | n | Rotation amount, 0-63. |
Definition at line 63 of file keccak256.cpp.
Referenced by keccak_f1600().
|
static |
Definition at line 28 of file keccak256.cpp.
Referenced by keccak_f1600().
|
static |
Definition at line 44 of file keccak256.cpp.
Referenced by keccak_f1600().