Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions astrobwt/astrobwtv3/sha256simd_vector_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package astrobwtv3

import (
"encoding/hex"
"testing"

sha256 "github.com/minio/sha256-simd"
)

// TestSha256SimdNistVectors confirms the vendored minio/sha256-simd v1.0.1
// produces the exact SHA-256 output specified by NIST FIPS 180-4 for a set
// of known vectors. This is the byte-level correctness gate for the
// consensus-critical sha256.Sum256 calls in pow.go (AstroBWTv3 PoW).
func TestSha256SimdNistVectors(t *testing.T) {
vectors := []struct {
input string
expect string // hex digest
}{
// "abc" — the canonical NIST FIPS 180-4 / RFC 6234 vector.
{"abc", "ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad"},
// empty input.
{"", "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},
// 56-byte input.
{"abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
"248d6a61d20638b8e5c026930c3e6039a33ce45964ff2167f6ecedd419db06c1"},
// 112-byte (two-block) — FIPS 180-4 Appendix B example.
{"abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu",
"cf5b16a778af8380036ce59e7b0492370b249b11e8f07a51afac45037afee9d1"},
}

for _, v := range vectors {
got := sha256.Sum256([]byte(v.input))
gotHex := hex.EncodeToString(got[:])
if gotHex != v.expect {
t.Fatalf("sha256.Sum256(%q) = %s, want %s", v.input, gotHex, v.expect)
}
}
}
57 changes: 0 additions & 57 deletions vendor/github.com/klauspost/cpuid/v2/.github/workflows/go.yml

This file was deleted.

30 changes: 0 additions & 30 deletions vendor/github.com/klauspost/cpuid/v2/.github/workflows/release.yml

This file was deleted.

24 changes: 0 additions & 24 deletions vendor/github.com/klauspost/cpuid/v2/.gitignore

This file was deleted.

350 changes: 347 additions & 3 deletions vendor/github.com/klauspost/cpuid/v2/README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion vendor/github.com/klauspost/cpuid/v2/cmd/cpuid/main.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

361 changes: 318 additions & 43 deletions vendor/github.com/klauspost/cpuid/v2/cpuid.go

Large diffs are not rendered by default.

42 changes: 41 additions & 1 deletion vendor/github.com/klauspost/cpuid/v2/cpuid_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/github.com/klauspost/cpuid/v2/detect_x86.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading