From dfa9771f4294d73aa131fb41a0f159b44375a1f5 Mon Sep 17 00:00:00 2001 From: Hojun-Cho Date: Tue, 2 Jun 2026 09:52:29 +0900 Subject: [PATCH] lib/crypto/sha256: cite #269 for the def-array-dim divergence (rule-7) The literal array dimensions ([64]u8/[8]u32/[64]u32) where Hare uses the BLOCKSZ def / [_]u32 are forced by ww rejecting a def in array-dimension position. rule-7 requires a retained divergence carry a filed-task pointer; add the #269 cite to the header divergence list and the state.x at-site note (previously described the limitation but cited no task). --- lib/crypto/sha256/sha256.ww | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/crypto/sha256/sha256.ww b/lib/crypto/sha256/sha256.ww index 6040f83f..e025da29 100644 --- a/lib/crypto/sha256/sha256.ww +++ b/lib/crypto/sha256/sha256.ww @@ -18,6 +18,10 @@ // [[sha256]] rather than pointing at a module-level const vtable // (the base64/memio/io convention; ww has no const-vtable-of-fn-ptrs // idiom). +// - array dimensions are integer literals (`[64]u8`, `[8]u32`, +// `[64]u32`) where Hare uses the `BLOCKSZ` def / `[_]u32`: ww rejects +// a def in array-dimension position ("array length must be an integer +// literal"). Retained language divergence — filed as #269. // - slice-to-slice copy assignment (`h.x[a..b] = b[..n]`) is spelled // as a byte loop — ww has no slice-copy assignment (cf lib/memio's // flat-field note). Same observable effect. @@ -78,7 +82,7 @@ def k: [64]u32 = [ export type state = struct { hash.hash, h: [8]u32, - x: [64]u8, // BLOCKSZ; array dims require an integer literal + x: [64]u8, // BLOCKSZ; def array dims rejected (#269) nx: size, ln: size, };