Go 1.27.1, and the code it can say more simply

Modules declare go 1.27.1 and the build images follow. go fix applied the
modernizers, and SHA3-256 now comes from the standard library's crypto/sha3;
omitzero is not applied, since it changes what the JSON says.

Co-authored-by: Hanzo Dev <[email protected]>
This commit is contained in:
2026-09-16 19:13:09 -07:00
co-authored by Hanzo Dev
parent e9f14a1c60
commit c72acf6e94
4 changed files with 17 additions and 25 deletions
+1 -4
View File
@@ -124,10 +124,7 @@ func (c *Conn) Write(b []byte) (int, error) {
const maxPlain = MaxFrameSize - chacha20poly1305.Overhead
written := 0
for written < len(b) {
end := written + maxPlain
if end > len(b) {
end = len(b)
}
end := min(written+maxPlain, len(b))
chunk := b[written:end]
if c.writeSeq == ^uint64(0) {
+5 -10
View File
@@ -1214,7 +1214,7 @@ func TestXWingDecapsulateLowOrderEph(t *testing.T) {
t.Fatalf("identity: %v", err)
}
ct := make([]byte, XWingCiphertextSize)
for i := 0; i < XWingCiphertextSize-32; i++ {
for i := range XWingCiphertextSize - 32 {
ct[i] = 0xCC
}
// Trailing 32 bytes are zero → low-order point → ssX errors.
@@ -1239,10 +1239,7 @@ type partialWriter struct {
func (w *partialWriter) Write(p []byte) (int, error) {
if w.written < w.succeed {
room := w.succeed - w.written
n := len(p)
if n > room {
n = room
}
n := min(len(p), room)
w.written += n
if n < len(p) {
return n, w.err
@@ -1432,12 +1429,10 @@ func TestConcurrentReadsAreSerialized(t *testing.T) {
// 8 concurrent writes from server, 8 concurrent reads on client.
const N = 8
var wg sync.WaitGroup
for i := 0; i < N; i++ {
wg.Add(1)
go func() {
defer wg.Done()
for range N {
wg.Go(func() {
_, _ = sConn.Write([]byte("z"))
}()
})
}
got := 0
for got < N {
+1 -1
View File
@@ -1,6 +1,6 @@
module github.com/luxfi/zwing
go 1.26.4
go 1.27.1
require (
github.com/luxfi/api v1.1.1
+1 -1
View File
@@ -5,12 +5,12 @@ package zwing
import (
"crypto/rand"
"crypto/sha3"
"errors"
"io"
"github.com/luxfi/crypto/mlkem"
"golang.org/x/crypto/curve25519"
"golang.org/x/crypto/sha3"
)
// X-Wing KEM combiner per IETF draft-connolly-cfrg-xwing-kem.