diff --git a/go.mod b/go.mod index 0a93718e4..f29e7bf6c 100644 --- a/go.mod +++ b/go.mod @@ -137,7 +137,7 @@ require ( github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/remyoudompheng/bigfft v0.0.0-20230126093431-47fa9a501578 // indirect + github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect github.com/rivo/uniseg v0.4.7 // indirect github.com/sassoftware/relic v7.2.1+incompatible // indirect github.com/secure-systems-lab/go-securesystemslib v0.10.0 // indirect @@ -195,7 +195,7 @@ require ( k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912 // indirect k8s.io/utils v0.0.0-20251002143259-bc988d571ff4 // indirect modernc.org/libc v1.22.2 // indirect - modernc.org/mathutil v1.5.0 // indirect + modernc.org/mathutil v1.7.1 // indirect modernc.org/memory v1.5.0 // indirect modernc.org/sqlite v1.20.3 // indirect sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect diff --git a/go.sum b/go.sum index e307fe795..d974432e7 100644 --- a/go.sum +++ b/go.sum @@ -505,9 +505,8 @@ github.com/prometheus/procfs v0.19.2/go.mod h1:M0aotyiemPhBCM0z5w87kL22CxfcH05Zp github.com/quay/clair/v2 v2.1.8 h1:F3C4CTno0UaGYOajWg19orY4sZe1YBYszL5o7UP6Lc8= github.com/quay/clair/v2 v2.1.8/go.mod h1:W98TX5hlrJA0+InaAtyM0R7x8e5SVonTSTj/Pj7ZGiY= github.com/remind101/migrate v0.0.0-20160423010909-d22d647232c2/go.mod h1:rhSvwcijY9wfmrBYrfCvapX8/xOTV46NAUjBRgUyJqc= -github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= -github.com/remyoudompheng/bigfft v0.0.0-20230126093431-47fa9a501578 h1:VstopitMQi3hZP0fzvnsLmzXZdQGc4bEcgu24cp+d4M= -github.com/remyoudompheng/bigfft v0.0.0-20230126093431-47fa9a501578/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= +github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE= +github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= @@ -820,8 +819,8 @@ k8s.io/utils v0.0.0-20251002143259-bc988d571ff4 h1:SjGebBtkBqHFOli+05xYbK8YF1Dzk k8s.io/utils v0.0.0-20251002143259-bc988d571ff4/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= modernc.org/libc v1.22.2 h1:4U7v51GyhlWqQmwCHj28Rdq2Yzwk55ovjFrdPjs8Hb0= modernc.org/libc v1.22.2/go.mod h1:uvQavJ1pZ0hIoC/jfqNoMLURIMhKzINIWypNM17puug= -modernc.org/mathutil v1.5.0 h1:rV0Ko/6SfM+8G+yKiyI830l3Wuz1zRutdslNoQ0kfiQ= -modernc.org/mathutil v1.5.0/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= +modernc.org/mathutil v1.7.1 h1:GCZVGXdaN8gTqB1Mf/usp1Y/hSqgI2vAGGP4jZMCxOU= +modernc.org/mathutil v1.7.1/go.mod h1:4p5IwJITfppl0G4sUEDtCr4DthTaT47/N3aT6MhfgJg= modernc.org/memory v1.5.0 h1:N+/8c5rE6EqugZwHii4IFsaJ7MUhoWX07J5tC/iI5Ds= modernc.org/memory v1.5.0/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU= modernc.org/sqlite v1.20.3 h1:SqGJMMxjj1PHusLxdYxeQSodg7Jxn9WWkaAQjKrntZs= diff --git a/vendor/github.com/remyoudompheng/bigfft/README b/vendor/github.com/remyoudompheng/bigfft/README index 303c61772..0fcd39d96 100644 --- a/vendor/github.com/remyoudompheng/bigfft/README +++ b/vendor/github.com/remyoudompheng/bigfft/README @@ -1,3 +1,14 @@ +This library is a toy proof-of-concept implementation of the +well-known Schonhage-Strassen method for multiplying integers. +It is not expected to have a real life usecase outside number +theory computations, nor is it expected to be used in any production +system. + +If you are using it in your project, you may want to carefully +examine the actual requirement or problem you are trying to solve. + +# Comparison with the standard library and GMP + Benchmarking math/big vs. bigfft Number size old ns/op new ns/op delta diff --git a/vendor/modernc.org/mathutil/Makefile b/vendor/modernc.org/mathutil/Makefile index 879017db7..0e144134c 100644 --- a/vendor/modernc.org/mathutil/Makefile +++ b/vendor/modernc.org/mathutil/Makefile @@ -28,7 +28,7 @@ cpu: clean go tool pprof -lines *.test cpu.out edit: - @ 1>/dev/null 2>/dev/null gvim -p Makefile *.go & + @ 1>/dev/null 2>/dev/null gvim -p Makefile go.mod builder.json *.go & editor: gofmt -l -s -w *.go diff --git a/vendor/modernc.org/mathutil/builder.json b/vendor/modernc.org/mathutil/builder.json new file mode 100644 index 000000000..029d1414e --- /dev/null +++ b/vendor/modernc.org/mathutil/builder.json @@ -0,0 +1,6 @@ +{ + "autogen": "", + "autoupdate": ".", + "autotag": ".", + "test": "." +} diff --git a/vendor/modernc.org/mathutil/mathutil.go b/vendor/modernc.org/mathutil/mathutil.go index 6db664093..a73c8a6e1 100644 --- a/vendor/modernc.org/mathutil/mathutil.go +++ b/vendor/modernc.org/mathutil/mathutil.go @@ -5,7 +5,7 @@ // Package mathutil provides utilities supplementing the standard 'math' and // 'math/rand' packages. // -// Release history and compatibility issues +// # Release history and compatibility issues // // 2020-12-20 v1.2.1 fixes MulOverflowInt64. // @@ -14,50 +14,52 @@ // 2018-10-21 Added BinaryLog // // 2018-04-25: New functions for determining Max/Min of nullable values. Ex: -// func MaxPtr(a, b *int) *int { -// func MinPtr(a, b *int) *int { -// func MaxBytePtr(a, b *byte) *byte { -// func MinBytePtr(a, b *byte) *byte { -// ... +// +// func MaxPtr(a, b *int) *int { +// func MinPtr(a, b *int) *int { +// func MaxBytePtr(a, b *byte) *byte { +// func MinBytePtr(a, b *byte) *byte { +// ... // // 2017-10-14: New variadic functions for Max/Min. Ex: -// func MaxVal(val int, vals ...int) int { -// func MinVal(val int, vals ...int) int { -// func MaxByteVal(val byte, vals ...byte) byte { -// func MinByteVal(val byte, vals ...byte) byte { -// ... +// +// func MaxVal(val int, vals ...int) int { +// func MinVal(val int, vals ...int) int { +// func MaxByteVal(val byte, vals ...byte) byte { +// func MinByteVal(val byte, vals ...byte) byte { +// ... // // 2016-10-10: New functions QuadPolyDiscriminant and QuadPolyFactors. // // 2013-12-13: The following functions have been REMOVED // -// func Uint64ToBigInt(n uint64) *big.Int -// func Uint64FromBigInt(n *big.Int) (uint64, bool) +// func Uint64ToBigInt(n uint64) *big.Int +// func Uint64FromBigInt(n *big.Int) (uint64, bool) // // 2013-05-13: The following functions are now DEPRECATED // -// func Uint64ToBigInt(n uint64) *big.Int -// func Uint64FromBigInt(n *big.Int) (uint64, bool) +// func Uint64ToBigInt(n uint64) *big.Int +// func Uint64FromBigInt(n *big.Int) (uint64, bool) // // These functions will be REMOVED with Go release 1.1+1. // // 2013-01-21: The following functions have been REMOVED // -// func MaxInt() int -// func MinInt() int -// func MaxUint() uint -// func UintPtrBits() int +// func MaxInt() int +// func MinInt() int +// func MaxUint() uint +// func UintPtrBits() int // // They are now replaced by untyped constants // -// MaxInt -// MinInt -// MaxUint -// UintPtrBits +// MaxInt +// MinInt +// MaxUint +// UintPtrBits // // Additionally one more untyped constant was added // -// IntBits +// IntBits // // This change breaks any existing code depending on the above removed // functions. They should have not been published in the first place, that was @@ -71,8 +73,8 @@ // 1.0.3+1 and REMOVED with Go release 1.0.3+2, b/c of // http://code.google.com/p/go/source/detail?r=954a79ee3ea8 // -// func Uint64ToBigInt(n uint64) *big.Int -// func Uint64FromBigInt(n *big.Int) (uint64, bool) +// func Uint64ToBigInt(n uint64) *big.Int +// func Uint64FromBigInt(n *big.Int) (uint64, bool) package mathutil // import "modernc.org/mathutil" import ( @@ -507,20 +509,20 @@ k == 1. Wrt pseudocode shown at http://en.wikipedia.org/wiki/Miller-Rabin_primality_test#Algorithm_and_running_time - Input: n > 3, an odd integer to be tested for primality; - Input: k, a parameter that determines the accuracy of the test - Output: composite if n is composite, otherwise probably prime - write n − 1 as 2^s·d with d odd by factoring powers of 2 from n − 1 - LOOP: repeat k times: - pick a random integer a in the range [2, n − 2] - x ← a^d mod n - if x = 1 or x = n − 1 then do next LOOP - for r = 1 .. s − 1 - x ← x^2 mod n - if x = 1 then return composite - if x = n − 1 then do next LOOP - return composite - return probably prime + Input: n > 3, an odd integer to be tested for primality; + Input: k, a parameter that determines the accuracy of the test + Output: composite if n is composite, otherwise probably prime + write n − 1 as 2^s·d with d odd by factoring powers of 2 from n − 1 + LOOP: repeat k times: + pick a random integer a in the range [2, n − 2] + x ← a^d mod n + if x = 1 or x = n − 1 then do next LOOP + for r = 1 .. s − 1 + x ← x^2 mod n + if x = 1 then return composite + if x = n − 1 then do next LOOP + return composite + return probably prime ... this function behaves like passing 1 for 'k' and additionally a fixed/non-random 'a'. Otherwise it's the same algorithm. @@ -1385,7 +1387,7 @@ func ClampInt64(v, lo, hi int64) int64 { // ToBase produces n in base b. For example // -// ToBase(2047, 22) -> [1, 5, 4] +// ToBase(2047, 22) -> [1, 5, 4] // // 1 * 22^0 1 // 5 * 22^1 110 diff --git a/vendor/modernc.org/mathutil/rat.go b/vendor/modernc.org/mathutil/rat.go index 2f3742f72..a4829ec19 100644 --- a/vendor/modernc.org/mathutil/rat.go +++ b/vendor/modernc.org/mathutil/rat.go @@ -6,10 +6,9 @@ package mathutil // import "modernc.org/mathutil" // QCmpUint32 compares a/b and c/d and returns: // -// -1 if a/b < c/d -// 0 if a/b == c/d -// +1 if a/b > c/d -// +// -1 if a/b < c/d +// 0 if a/b == c/d +// +1 if a/b > c/d func QCmpUint32(a, b, c, d uint32) int { switch x, y := uint64(a)*uint64(d), uint64(b)*uint64(c); { case x < y: diff --git a/vendor/modernc.org/mathutil/rnd.go b/vendor/modernc.org/mathutil/rnd.go index 598bad4fe..08454cd81 100644 --- a/vendor/modernc.org/mathutil/rnd.go +++ b/vendor/modernc.org/mathutil/rnd.go @@ -15,12 +15,12 @@ import ( // this code doesn't produce values at constant delta (mod cycle length). // The 32 bit limit is per this implementation, the algorithm used has no intrinsic limit on the cycle size. // Properties include: -// - Adjustable limits on creation (hi, lo). -// - Positionable/randomly accessible (Pos, Seek). -// - Repeatable (deterministic). -// - Can run forward or backward (Next, Prev). -// - For a billion numbers cycle the Next/Prev PRN can be produced in cca 100-150ns. -// That's like 5-10 times slower compared to PRNs generated using the (non FC) rand package. +// - Adjustable limits on creation (hi, lo). +// - Positionable/randomly accessible (Pos, Seek). +// - Repeatable (deterministic). +// - Can run forward or backward (Next, Prev). +// - For a billion numbers cycle the Next/Prev PRN can be produced in cca 100-150ns. +// That's like 5-10 times slower compared to PRNs generated using the (non FC) rand package. type FC32 struct { cycle int64 // On average: 3 * delta / 2, (HQ: 2 * delta) delta int64 // hi - lo diff --git a/vendor/modules.txt b/vendor/modules.txt index 0c3a77d7a..316ef7173 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -651,7 +651,7 @@ github.com/pmezard/go-difflib/difflib # github.com/quay/clair/v2 v2.1.8 ## explicit; go 1.12 github.com/quay/clair/v2/pkg/tarutil -# github.com/remyoudompheng/bigfft v0.0.0-20230126093431-47fa9a501578 +# github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec ## explicit; go 1.12 github.com/remyoudompheng/bigfft # github.com/rivo/uniseg v0.4.7 @@ -1586,8 +1586,8 @@ modernc.org/libc/utime modernc.org/libc/uuid modernc.org/libc/uuid/uuid modernc.org/libc/wctype -# modernc.org/mathutil v1.5.0 -## explicit; go 1.13 +# modernc.org/mathutil v1.7.1 +## explicit; go 1.21 modernc.org/mathutil # modernc.org/memory v1.5.0 ## explicit; go 1.18