mirror of
https://github.com/cheat/cheat.git
synced 2026-03-07 11:13:33 +01:00
chore: modernize CI and update Go toolchain
- Bump Go from 1.19 to 1.26 and update all dependencies - Rewrite CI workflow with matrix strategy (Linux, macOS, Windows) - Update GitHub Actions to current versions (checkout@v4, setup-go@v5) - Update CodeQL actions from v1 to v3 - Fix cross-platform bug in mock/path.go (path.Join -> filepath.Join) - Clean up dependabot config (weekly schedule, remove stale ignore) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
3
vendor/github.com/cloudflare/circl/dh/x25519/curve_amd64.s
generated
vendored
3
vendor/github.com/cloudflare/circl/dh/x25519/curve_amd64.s
generated
vendored
@@ -1,4 +1,5 @@
|
||||
// +build amd64
|
||||
//go:build amd64 && !purego
|
||||
// +build amd64,!purego
|
||||
|
||||
#include "textflag.h"
|
||||
|
||||
|
||||
3
vendor/github.com/cloudflare/circl/dh/x448/curve_amd64.s
generated
vendored
3
vendor/github.com/cloudflare/circl/dh/x448/curve_amd64.s
generated
vendored
@@ -1,4 +1,5 @@
|
||||
// +build amd64
|
||||
//go:build amd64 && !purego
|
||||
// +build amd64,!purego
|
||||
|
||||
#include "textflag.h"
|
||||
|
||||
|
||||
10
vendor/github.com/cloudflare/circl/ecc/goldilocks/curve.go
generated
vendored
10
vendor/github.com/cloudflare/circl/ecc/goldilocks/curve.go
generated
vendored
@@ -18,6 +18,9 @@ func (Curve) Identity() *Point {
|
||||
func (Curve) IsOnCurve(P *Point) bool {
|
||||
x2, y2, t, t2, z2 := &fp.Elt{}, &fp.Elt{}, &fp.Elt{}, &fp.Elt{}, &fp.Elt{}
|
||||
rhs, lhs := &fp.Elt{}, &fp.Elt{}
|
||||
// Check z != 0
|
||||
eq0 := !fp.IsZero(&P.z)
|
||||
|
||||
fp.Mul(t, &P.ta, &P.tb) // t = ta*tb
|
||||
fp.Sqr(x2, &P.x) // x^2
|
||||
fp.Sqr(y2, &P.y) // y^2
|
||||
@@ -27,13 +30,14 @@ func (Curve) IsOnCurve(P *Point) bool {
|
||||
fp.Mul(rhs, t2, ¶mD) // dt^2
|
||||
fp.Add(rhs, rhs, z2) // z^2 + dt^2
|
||||
fp.Sub(lhs, lhs, rhs) // x^2 + y^2 - (z^2 + dt^2)
|
||||
eq0 := fp.IsZero(lhs)
|
||||
eq1 := fp.IsZero(lhs)
|
||||
|
||||
fp.Mul(lhs, &P.x, &P.y) // xy
|
||||
fp.Mul(rhs, t, &P.z) // tz
|
||||
fp.Sub(lhs, lhs, rhs) // xy - tz
|
||||
eq1 := fp.IsZero(lhs)
|
||||
return eq0 && eq1
|
||||
eq2 := fp.IsZero(lhs)
|
||||
|
||||
return eq0 && eq1 && eq2
|
||||
}
|
||||
|
||||
// Generator returns the generator point.
|
||||
|
||||
33
vendor/github.com/cloudflare/circl/internal/conv/conv.go
generated
vendored
33
vendor/github.com/cloudflare/circl/internal/conv/conv.go
generated
vendored
@@ -5,6 +5,8 @@ import (
|
||||
"fmt"
|
||||
"math/big"
|
||||
"strings"
|
||||
|
||||
"golang.org/x/crypto/cryptobyte"
|
||||
)
|
||||
|
||||
// BytesLe2Hex returns an hexadecimal string of a number stored in a
|
||||
@@ -138,3 +140,34 @@ func BigInt2Uint64Le(z []uint64, x *big.Int) {
|
||||
z[i] = 0
|
||||
}
|
||||
}
|
||||
|
||||
// MarshalBinary encodes a value into a byte array in a format readable by UnmarshalBinary.
|
||||
func MarshalBinary(v cryptobyte.MarshalingValue) ([]byte, error) {
|
||||
const DefaultSize = 32
|
||||
b := cryptobyte.NewBuilder(make([]byte, 0, DefaultSize))
|
||||
b.AddValue(v)
|
||||
return b.Bytes()
|
||||
}
|
||||
|
||||
// MarshalBinaryLen encodes a value into an array of n bytes in a format readable by UnmarshalBinary.
|
||||
func MarshalBinaryLen(v cryptobyte.MarshalingValue, length uint) ([]byte, error) {
|
||||
b := cryptobyte.NewFixedBuilder(make([]byte, 0, length))
|
||||
b.AddValue(v)
|
||||
return b.Bytes()
|
||||
}
|
||||
|
||||
// A UnmarshalingValue decodes itself from a cryptobyte.String and advances the pointer.
|
||||
// It reports whether the read was successful.
|
||||
type UnmarshalingValue interface {
|
||||
Unmarshal(*cryptobyte.String) bool
|
||||
}
|
||||
|
||||
// UnmarshalBinary recovers a value from a byte array.
|
||||
// It returns an error if the read was unsuccessful.
|
||||
func UnmarshalBinary(v UnmarshalingValue, data []byte) (err error) {
|
||||
s := cryptobyte.String(data)
|
||||
if data == nil || !v.Unmarshal(&s) || !s.Empty() {
|
||||
err = fmt.Errorf("cannot read %T from input string", v)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
6
vendor/github.com/cloudflare/circl/internal/sha3/xor_unaligned.go
generated
vendored
6
vendor/github.com/cloudflare/circl/internal/sha3/xor_unaligned.go
generated
vendored
@@ -14,14 +14,14 @@ import "unsafe"
|
||||
type storageBuf [maxRate / 8]uint64
|
||||
|
||||
func (b *storageBuf) asBytes() *[maxRate]byte {
|
||||
return (*[maxRate]byte)(unsafe.Pointer(b))
|
||||
return (*[maxRate]byte)(unsafe.Pointer(b)) //nolint:gosec
|
||||
}
|
||||
|
||||
// xorInuses unaligned reads and writes to update d.a to contain d.a
|
||||
// XOR buf.
|
||||
func xorIn(d *State, buf []byte) {
|
||||
n := len(buf)
|
||||
bw := (*[maxRate / 8]uint64)(unsafe.Pointer(&buf[0]))[: n/8 : n/8]
|
||||
bw := (*[maxRate / 8]uint64)(unsafe.Pointer(&buf[0]))[: n/8 : n/8] //nolint:gosec
|
||||
if n >= 72 {
|
||||
d.a[0] ^= bw[0]
|
||||
d.a[1] ^= bw[1]
|
||||
@@ -56,6 +56,6 @@ func xorIn(d *State, buf []byte) {
|
||||
}
|
||||
|
||||
func copyOut(d *State, buf []byte) {
|
||||
ab := (*[maxRate]uint8)(unsafe.Pointer(&d.a[0]))
|
||||
ab := (*[maxRate]uint8)(unsafe.Pointer(&d.a[0])) //nolint:gosec
|
||||
copy(buf, ab[:])
|
||||
}
|
||||
|
||||
3
vendor/github.com/cloudflare/circl/math/fp25519/fp_amd64.s
generated
vendored
3
vendor/github.com/cloudflare/circl/math/fp25519/fp_amd64.s
generated
vendored
@@ -1,4 +1,5 @@
|
||||
// +build amd64
|
||||
//go:build amd64 && !purego
|
||||
// +build amd64,!purego
|
||||
|
||||
#include "textflag.h"
|
||||
#include "fp_amd64.h"
|
||||
|
||||
3
vendor/github.com/cloudflare/circl/math/fp448/fp_amd64.s
generated
vendored
3
vendor/github.com/cloudflare/circl/math/fp448/fp_amd64.s
generated
vendored
@@ -1,4 +1,5 @@
|
||||
// +build amd64
|
||||
//go:build amd64 && !purego
|
||||
// +build amd64,!purego
|
||||
|
||||
#include "textflag.h"
|
||||
#include "fp_amd64.h"
|
||||
|
||||
16
vendor/github.com/cloudflare/circl/math/integer.go
generated
vendored
Normal file
16
vendor/github.com/cloudflare/circl/math/integer.go
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
package math
|
||||
|
||||
import "math/bits"
|
||||
|
||||
// NextPow2 finds the next power of two (N=2^k, k>=0) greater than n.
|
||||
// If n is already a power of two, then this function returns n, and log2(n).
|
||||
func NextPow2(n uint) (N uint, k uint) {
|
||||
if bits.OnesCount(n) == 1 {
|
||||
k = uint(bits.TrailingZeros(n))
|
||||
N = n
|
||||
} else {
|
||||
k = uint(bits.Len(n))
|
||||
N = uint(1) << k
|
||||
}
|
||||
return
|
||||
}
|
||||
2
vendor/github.com/cloudflare/circl/sign/ed25519/point.go
generated
vendored
2
vendor/github.com/cloudflare/circl/sign/ed25519/point.go
generated
vendored
@@ -164,7 +164,7 @@ func (P *pointR1) isEqual(Q *pointR1) bool {
|
||||
fp.Mul(r, r, &P.z)
|
||||
fp.Sub(l, l, r)
|
||||
b = b && fp.IsZero(l)
|
||||
return b
|
||||
return b && !fp.IsZero(&P.z) && !fp.IsZero(&Q.z)
|
||||
}
|
||||
|
||||
func (P *pointR3) neg() {
|
||||
|
||||
2
vendor/github.com/cloudflare/circl/sign/ed448/ed448.go
generated
vendored
2
vendor/github.com/cloudflare/circl/sign/ed448/ed448.go
generated
vendored
@@ -206,7 +206,7 @@ func newKeyFromSeed(privateKey, seed []byte) {
|
||||
|
||||
func signAll(signature []byte, privateKey PrivateKey, message, ctx []byte, preHash bool) {
|
||||
if len(ctx) > ContextMaxSize {
|
||||
panic(fmt.Errorf("ed448: bad context length: " + strconv.Itoa(len(ctx))))
|
||||
panic(fmt.Errorf("ed448: bad context length: %v", len(ctx)))
|
||||
}
|
||||
|
||||
H := sha3.NewShake256()
|
||||
|
||||
9
vendor/github.com/cloudflare/circl/sign/sign.go
generated
vendored
9
vendor/github.com/cloudflare/circl/sign/sign.go
generated
vendored
@@ -38,6 +38,12 @@ type PrivateKey interface {
|
||||
encoding.BinaryMarshaler
|
||||
}
|
||||
|
||||
// A private key that retains the seed with which it was generated.
|
||||
type Seeded interface {
|
||||
// returns the seed if retained, otherwise nil
|
||||
Seed() []byte
|
||||
}
|
||||
|
||||
// A Scheme represents a specific instance of a signature scheme.
|
||||
type Scheme interface {
|
||||
// Name of the scheme.
|
||||
@@ -107,4 +113,7 @@ var (
|
||||
// ErrContextNotSupported is the error used if a context is not
|
||||
// supported.
|
||||
ErrContextNotSupported = errors.New("context not supported")
|
||||
|
||||
// ErrContextTooLong is the error used if the context string is too long.
|
||||
ErrContextTooLong = errors.New("context string too long")
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user