From 4178516468a6f938349c85ace0b91e781d40afbb Mon Sep 17 00:00:00 2001 From: wregulski Date: Thu, 17 Oct 2024 09:44:43 +0200 Subject: [PATCH 1/4] fix: proper comment for DecodeScriptHex function --- script/script_chunk.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/script_chunk.go b/script/script_chunk.go index 0942ae33..24597b2a 100644 --- a/script/script_chunk.go +++ b/script/script_chunk.go @@ -215,7 +215,7 @@ func PushDataPrefix(data []byte) ([]byte, error) { return b, nil } -// DecodeStringParts takes a hex string and decodes the opcodes in it +// DecodeScriptHex takes a hex string and decodes the opcodes in it // returning an array of opcode parts (which could be opcodes or data // pushed to the stack). func DecodeScriptHex(s string) ([]*ScriptChunk, error) { From f5bc7a0ac0e18c36f91c26234366fff6dee05bd9 Mon Sep 17 00:00:00 2001 From: wregulski Date: Thu, 17 Oct 2024 09:47:18 +0200 Subject: [PATCH 2/4] fix: remove unused const fieldOverflowBits --- primitives/ec/field.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/primitives/ec/field.go b/primitives/ec/field.go index f8096a80..024161d7 100644 --- a/primitives/ec/field.go +++ b/primitives/ec/field.go @@ -71,10 +71,6 @@ const ( // 2^(fieldBase*i) where i is the word position. fieldBase = 26 - // fieldOverflowBits is the minimum number of "overflow" bits for each - // word in the field value. - fieldOverflowBits = 32 - fieldBase //nolint:varcheck,deadcode,unused // reasons. - // fieldBaseMask is the mask for the bits in each word needed to // represent the numeric base of each word (except the most significant // word). From 6ed7ab7182fdf135bf4ea5103180b30e2c177bae Mon Sep 17 00:00:00 2001 From: wregulski Date: Thu, 17 Oct 2024 09:48:34 +0200 Subject: [PATCH 3/4] fix: proper loop on totalKeyShares function --- primitives/ec/privatekey.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/primitives/ec/privatekey.go b/primitives/ec/privatekey.go index 6b61555c..070132b6 100644 --- a/primitives/ec/privatekey.go +++ b/primitives/ec/privatekey.go @@ -253,7 +253,7 @@ func (p *PrivateKey) ToKeyShares(threshold int, totalShares int) (keyShares *key } points := make([]*keyshares.PointInFiniteField, 0) - for range totalShares { + for i := 0; i < totalShares; i++ { pk, err := NewPrivateKey() if err != nil { return nil, err From 68e8b123a520104c7299af170e491dae6a84119d Mon Sep 17 00:00:00 2001 From: wregulski Date: Fri, 18 Oct 2024 15:12:25 +0200 Subject: [PATCH 4/4] Revert "fix: proper loop on totalKeyShares function" This reverts commit 6ed7ab7182fdf135bf4ea5103180b30e2c177bae. --- primitives/ec/privatekey.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/primitives/ec/privatekey.go b/primitives/ec/privatekey.go index 070132b6..6b61555c 100644 --- a/primitives/ec/privatekey.go +++ b/primitives/ec/privatekey.go @@ -253,7 +253,7 @@ func (p *PrivateKey) ToKeyShares(threshold int, totalShares int) (keyShares *key } points := make([]*keyshares.PointInFiniteField, 0) - for i := 0; i < totalShares; i++ { + for range totalShares { pk, err := NewPrivateKey() if err != nil { return nil, err