17#ifndef PROTOCORE_SSH_KEXHASH_H
18#define PROTOCORE_SSH_KEXHASH_H
25#define SSH_KEXHASH_MAX_LEN 64
35static inline void ssh_kexhash_init(
SshKexHash *h,
bool is512)
48static inline void ssh_kexhash_update(
SshKexHash *h,
const uint8_t *data,
size_t len)
73static inline size_t ssh_kexhash_len(
bool is512)
PC_CRYPTO_HOT void pc_sha256_init(pc_sha256_ctx *ctx)
Initialize a streaming SHA-256 context (ctx must not be NULL).
void pc_sha256_final(pc_sha256_ctx *ctx, uint8_t digest[PC_SHA256_DIGEST_LEN])
Finalize the hash and write the 32-byte digest. The context is undefined afterwards; call init() agai...
void pc_sha256_update(pc_sha256_ctx *ctx, const uint8_t *data, size_t len)
Feed len bytes of data into the running hash.
SHA-256 (FIPS 180-4) - streaming context and one-shot API.
#define PC_SHA256_DIGEST_LEN
SHA-256 digest length in bytes.
void pc_sha512_update(pc_sha512_ctx *ctx, const uint8_t *data, size_t len)
Feed len bytes of data into the running hash.
PC_CRYPTO_HOT void pc_sha512_init(pc_sha512_ctx *ctx)
Initialize a streaming SHA-512 context (ctx must not be NULL).
void pc_sha512_final(pc_sha512_ctx *ctx, uint8_t digest[PC_SHA512_DIGEST_LEN])
Finalize the hash and write the 64-byte digest. The context is undefined afterwards; call init() agai...
SHA-512 (FIPS 180-4) - streaming context and one-shot API.
#define PC_SHA512_DIGEST_LEN
SHA-512 digest length in bytes.
#define SSH_KEXHASH_MAX_LEN
longest exchange-hash / session_id (SHA-512)
A key-exchange digest bound to one of the SSH KEX hashes (SHA-256 or SHA-512).
Streaming SHA-256 context.
Streaming SHA-512 context.