The header scan (Captain Bob, 2026-11-10): 788 source files -- 351 with the
SL-1.0 header, 12 with the old name (docs/working/experiments, kept by
ruling), 31 under someone else's licence (tools/kconfig, Linux's, GPL-2.0:
kept), and 394 with none. Ruled: the SPDX form; capsules (.4th, .f18) and
proofs (.thy) left for a ruling of their own (mkcapsule's 64x16 block format,
content-addressed capsules).
253 files now begin
SPDX-License-Identifier: LicenseRef-Starship-1.0
Copyright (c) 2023-2026 Robert A. James
as a /* */ block (C, headers, assembly, linker scripts) or # lines (scripts,
Makefiles, Kconfig; below a shebang or a coding line); tools/mkcapsule.c,
which had the copyright line, gets the SPDX line only.
Not touched: docs/working/ (archive and old campaign material, as the
ruling kept the experiments); v4/system/post_cases.c (generated by
v4/tools/mkpost.py, "do not edit" -- the generator has the header).
Comments only: the kernel builds on amd64, aarch64, riscv64; make -C v4
test-32: 39 programs, 0 failures; every changed script parses.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GE3SDvQn5EoxdGufk84zz2
34 lines
1.2 KiB
C
34 lines
1.2 KiB
C
/* SPDX-License-Identifier: LicenseRef-Starship-1.0
|
|
* Copyright (c) 2023-2026 Robert A. James
|
|
*/
|
|
/* sha512.h -- freestanding SHA-512 (FIPS 180-4 / RFC 6234), C99, no libc
|
|
* beyond memcpy/memset (both available in the kernel via
|
|
* src/starkernel/vm/host/shim.c). No __int128 used -- 64-bit words only,
|
|
* portable to amd64/aarch64/riscv64 without libgcc helpers.
|
|
*/
|
|
#ifndef SHA512_H
|
|
#define SHA512_H
|
|
|
|
#include <stdint.h>
|
|
#include <stddef.h>
|
|
|
|
typedef struct {
|
|
uint64_t state[8];
|
|
uint64_t bitlen; /* total message length in bits, low 64 bits
|
|
* (SHA-512 defines a 128-bit length field; a
|
|
* single uint64_t of bit-length is enough for
|
|
* any message this kernel will ever hash --
|
|
* capsules and certs, not exabyte streams) */
|
|
uint8_t buf[128];
|
|
size_t buf_len;
|
|
} sha512_ctx_t;
|
|
|
|
void sha512_init(sha512_ctx_t *ctx);
|
|
void sha512_update(sha512_ctx_t *ctx, const uint8_t *data, size_t len);
|
|
void sha512_final(sha512_ctx_t *ctx, uint8_t out[64]);
|
|
|
|
/* Convenience one-shot. */
|
|
void sha512(const uint8_t *data, size_t len, uint8_t out[64]);
|
|
|
|
#endif /* SHA512_H */
|