mirror of
https://github.com/luxfi/zwing.git
synced 2026-09-24 00:24:38 +00:00
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:
+1
-4
@@ -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
@@ -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,6 +1,6 @@
|
||||
module github.com/luxfi/zwing
|
||||
|
||||
go 1.26.4
|
||||
go 1.27.1
|
||||
|
||||
require (
|
||||
github.com/luxfi/api v1.1.1
|
||||
|
||||
Reference in New Issue
Block a user