crypto/sha1 — validation proof

Go’s own crypto/sha1 test suite, converted to C# by go2cs, built against the converted standard library, run under the Go-semantics test host, and compared verdict for verdict against a clean go test -json baseline of the same sources. This page is generated by the converter from that comparison — it is the evidence behind the crypto/sha1 row in Validated Test Packages.

Validated 2026-11-08 · converter 485051f31

13 matched · 1 disclosed — Go 1.26.10, windows/amd64, converted package src/core/crypto/sha1.

Measured at Release (tiered JIT off), oracle go version go1.26.10 windows/amd64.

Verdicts

Test go test go2cs
TestAllocations pass fail (disclosed)
TestBlockSize pass pass
TestExtraMethods pass pass
TestGolden pass pass
TestGoldenMarshal pass pass
TestLargeHashes pass pass
TestSHA1Hash pass pass
TestSHA1Hash/Clone pass pass
TestSHA1Hash/OutOfBoundsRead pass pass
TestSHA1Hash/ResetState pass pass
TestSHA1Hash/StatefulWrite pass pass
TestSHA1Hash/SumAppend pass pass
TestSHA1Hash/WriteWithoutError pass pass
TestSize pass pass

Disclosed divergences

A disclosed divergence is a specific Go assertion this conversion does not satisfy — not a skipped test and not a tolerance. Each one is pinned by exact failure signature in the package’s hand-owned go2cs_test_disclosures.json; a disclosed test that fails any other way is still a hard mismatch.

The Class column says which kind each one is: a deferred entry is an assertion the managed CLR can meet, pinned against the named plan that will retire it; every other class is one it provably cannot satisfy.

Test Class Pinned reason
TestAllocations deferred want-zero AllocsPerRun assert: Sum copies the digest (d0 := *d) so the caller can keep writing, and that copy must deep-copy the digest’s [5]uint32 state and [64]byte block – golib’s array is a struct over a heap T[], so the copy is two managed allocations where Go's is stack-resident. The converted path counts 9 per run on windows and linux: the copy's array storage, non-escaping local buffers and the heap box for the digest. New() is outside the measured closure, so no hash.Hash shell is created per run. Deferred: .NET has value-typed fixed-size storage for a Go array value, and planned work removes the local buffers and the box; the entry retires only at zero bytes.

Withdrawn where a shipped architecture does not build the test

One converted build of a GOOS serves every RID it ships, and the roster banks one count for it. A test whose file one of those architectures does not build is therefore withdrawn from both sides on that GOOS, on every RID, and is not claimed by that GOOS’s count. It still runs, and is compared, on every GOOS that builds it:

Excluded declarations

Declarations filtered from both sides of the comparison, and therefore not claimed above: Benchmark, Fuzz and Example declarations the converted host does not execute, plus any test requiring a capability the managed runtime does not provide — a testing member the host has not implemented, or a platform behavior it provably cannot reproduce. Each is named with the capability it needs.