|
DeterministicESPAsyncWebServer v6.27.1
Zero-allocation, bounded-execution async HTTP server for ESP32
|
ChaCha20 (RFC 8439) - implementation. See ssh_chacha20.h. More...
#include "network_drivers/presentation/ssh/crypto/ssh_chacha20.h"#include "shared_primitives/crypto_opt.h"Go to the source code of this file.
Namespaces | |
| namespace | DETWS_CRYPTO_HOT |
Macros | |
| #define | QR(a, b, c, d) |
Functions | |
| uint32_t | DETWS_CRYPTO_HOT::rd_le32 (const uint8_t *p) |
| uint32_t | DETWS_CRYPTO_HOT::rotl32 (uint32_t v, int c) |
| void | DETWS_CRYPTO_HOT::chacha_core (const uint32_t in[16], uint8_t out[64]) |
| void | ssh_chacha20_xor (const uint8_t key[SSH_CHACHA20_KEY_LEN], const uint8_t iv[8], uint64_t counter, const uint8_t *in, uint8_t *out, size_t len) |
XOR len bytes of in with the ChaCha20 keystream into out (OpenSSH layout). | |
| void | ssh_chacha20_block_ietf (const uint8_t key[SSH_CHACHA20_KEY_LEN], uint32_t counter, const uint8_t nonce[12], uint8_t out[SSH_CHACHA20_BLOCK_LEN]) |
| One 64-byte ChaCha20 keystream block in the RFC 8439 layout (for the KAT). | |
Variables | |
| const uint32_t | DETWS_CRYPTO_HOT::SIGMA0 = 0x61707865 |
| const uint32_t | DETWS_CRYPTO_HOT::SIGMA1 = 0x3320646e |
| const uint32_t | DETWS_CRYPTO_HOT::SIGMA2 = 0x79622d32 |
| const uint32_t | DETWS_CRYPTO_HOT::SIGMA3 = 0x6b206574 |
ChaCha20 (RFC 8439) - implementation. See ssh_chacha20.h.
Definition in file ssh_chacha20.cpp.
| #define QR | ( | a, | |
| b, | |||
| c, | |||
| d | |||
| ) |
Definition at line 31 of file ssh_chacha20.cpp.
| void ssh_chacha20_xor | ( | const uint8_t | key[SSH_CHACHA20_KEY_LEN], |
| const uint8_t | iv[8], | ||
| uint64_t | counter, | ||
| const uint8_t * | in, | ||
| uint8_t * | out, | ||
| size_t | len | ||
| ) |
XOR len bytes of in with the ChaCha20 keystream into out (OpenSSH layout).
| key | 32-byte key. |
| iv | 8-byte nonce (OpenSSH uses the packet sequence number, big-endian). |
| counter | initial 64-bit block counter (0 for the Poly1305-key / length blocks, 1 for the packet payload); it increments per 64-byte block. |
| in | plaintext (or ciphertext when decrypting); may be nullptr to emit raw keystream. |
| out | output buffer (len bytes); may alias in. |
Definition at line 79 of file ssh_chacha20.cpp.
Referenced by ssh_chachapoly_decrypt(), ssh_chachapoly_encrypt(), and ssh_chachapoly_get_length().
| void ssh_chacha20_block_ietf | ( | const uint8_t | key[SSH_CHACHA20_KEY_LEN], |
| uint32_t | counter, | ||
| const uint8_t | nonce[12], | ||
| uint8_t | out[SSH_CHACHA20_BLOCK_LEN] | ||
| ) |
One 64-byte ChaCha20 keystream block in the RFC 8439 layout (for the KAT).
| key | 32-byte key. |
| counter | 32-bit block counter (word 12). |
| nonce | 12-byte nonce (words 13-15). |
| out | 64-byte keystream block. |
Definition at line 106 of file ssh_chacha20.cpp.