semq-sys 1.1.0

Raw FFI bindings to the SEMQ native library.
Documentation
/*
 * Copyright (c) 2026 The SEMQ Group Inc.
 * Licensed under the PolyForm Noncommercial License 1.0.0. See LICENSE.md for terms.
 */

/* semq_sha256.h — streaming SHA-256 (FIPS 180-4). Internal. */

#ifndef SEMQ_SHA256_H
#define SEMQ_SHA256_H

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

typedef struct {
    uint32_t state[8];
    uint64_t bit_len;
    uint8_t  buffer[64];
    uint32_t buffered;
    uint8_t  sha_checked;
    void (*block)(uint32_t state[8], const uint8_t input[64]);
} semq_sha256_ctx_t;

extern const uint32_t semqi_sha256_k[64];
#if defined(__aarch64__) || defined(_M_ARM64)
void semqi_sha256_block_arm(uint32_t state[8], const uint8_t block[64]);
#endif

void semq_sha256_init(semq_sha256_ctx_t* ctx);
void semq_sha256_update(semq_sha256_ctx_t* ctx, const uint8_t* data, size_t len);
void semq_sha256_final(semq_sha256_ctx_t* ctx, uint8_t out[32]);

#endif /* SEMQ_SHA256_H */