/* Copyright 2026 Rhett Creighton - Apache License 2.0
 *
 * SHA3-256 window commitments over consecutive block payloads.
 *
 * For a chain at height H_tip, the table contains
 * ceil((H_tip + 1) / SHA3_WINDOW_SIZE) entries. Entry i covers
 * heights [i*SHA3_WINDOW_SIZE .. min((i+1)*SHA3_WINDOW_SIZE - 1, H_tip)].
 *
 * Each `hash` is SHA3-256 over the concatenation of the raw block
 * payloads (hex-decoded, equivalent to `getblock <hash> 0` bytes) in
 * height order.
 *
 * Generated by tools/gen_sha3_windows. Do not edit by hand. */

#ifndef ZCL_CHAIN_SHA3_WINDOWS_H
#define ZCL_CHAIN_SHA3_WINDOWS_H

#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>

#define SHA3_WINDOW_SIZE 1000

struct sha3_window {
    int32_t start_height;
    uint8_t hash[32];
};

extern const struct sha3_window g_sha3_windows[];
extern const size_t g_sha3_windows_count;

bool sha3_windows_verify_window(int window_index,
                                const uint8_t *block_payloads_concat,
                                size_t total_len);

#endif /* ZCL_CHAIN_SHA3_WINDOWS_H */
