51#ifndef DETERMINISTICESPASYNCWEBSERVER_SSH_DH_H
52#define DETERMINISTICESPASYNCWEBSERVER_SSH_DH_H
126 bool k_is_string =
false);
129#define SSH_KDF_MAX (4 * SSH_SHA256_DIGEST_LEN)
143 bool k_is_string =
false);
User-facing configuration for DeterministicESPAsyncWebServer.
2048-bit big-integer arithmetic for DH-group14 and RSA-2048.
void ssh_dh_derive_keys(uint8_t i, const uint8_t K_be[256], const uint8_t H[SSH_SHA256_DIGEST_LEN])
Derive the six session keys from shared secret K and exchange hash H.
void ssh_dh_derive_keys_sid(uint8_t i, const uint8_t K_be[256], const uint8_t H[SSH_SHA256_DIGEST_LEN], const uint8_t session_id[SSH_SHA256_DIGEST_LEN], uint8_t cipher_alg, uint8_t mac_alg, bool k_is_string=false)
Derive session keys with an explicit session id (RFC 4253 §7.2).
void ssh_rng_fill(uint8_t *buf, size_t len)
Fill len bytes of buf with cryptographically random data.
void ssh_kdf_derive(const uint8_t K_be[256], const uint8_t H[SSH_SHA256_DIGEST_LEN], const uint8_t session_id[SSH_SHA256_DIGEST_LEN], char label, uint8_t *out, size_t out_len, bool k_is_string=false)
RFC 4253 §7.2 key derivation for any length up to SSH_KDF_MAX.
int ssh_dh_generate(uint8_t i)
Generate the server ephemeral DH key pair for connection slot i.
SSH session key material - types, pools, and security model.
SHA-256 (FIPS 180-4) - streaming context and one-shot API.
#define SSH_SHA256_DIGEST_LEN
SHA-256 digest length in bytes.