Skip to content

Commit

Permalink
Changes to be committed:
Browse files Browse the repository at this point in the history
	modified:   .golangci.yml
	modified:   README.md
	modified:   bip39.go
	modified:   bip39_test.go
	modified:   cmd/cli/bip39.go
	modified:   example_test.go
	modified:   go.mod
	modified:   go.sum
  • Loading branch information
gaikov-everstake committed Dec 14, 2023
1 parent 17dcc94 commit 6067f45
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 30 deletions.
12 changes: 2 additions & 10 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ run:
max-same-issues: 0
max-issues-per-linter: 0
skip-dirs:
- wordlists
- wordlists

issues:
exclude-rules:
Expand All @@ -17,18 +17,10 @@ issues:
text: "ST1005: error strings should not be capitalized"
linters:
- stylecheck
- path: (bip39|bip39_test)\.go
text: "File is not `goimports`-ed"
linters:
- goimports
- path: (bip39|bip39_test)\.go
- path: (cmd/cli/bop39|bip39|bip39_test|example_test)\.go
text: "is not allowed from list 'Main'"
linters:
- depguard
- path: (cmd/cli/bip39|bip39|bip39_test|example_test)\.go
text: "put a space between `//` and comment text"
linters:
- gocritic
- path: cmd/cli/bip39\.go
text: "lines are duplicate of"
linters:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Generation, verification of mnemonics in BIP39 standard and obtaining their hash in Argon2id format

#### Fork: https://github.com/tyler-smith/go-bip39
### Fork: https://github.com/tyler-smith/go-bip39

## Build
go build cmd/cli/bip39.go
Expand Down
5 changes: 3 additions & 2 deletions bip39.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import (
"math/big"
"strings"

"go-bip39/wordlists"
"bip39/wordlists"

"golang.org/x/crypto/pbkdf2"
)

Expand All @@ -26,7 +27,7 @@ var (
bigTwo = big.NewInt(2)

// wordLengthChecksumMasksMapping is used to isolate the checksum bits from
//the entropy+checksum byte array.
// the entropy+checksum byte array.
wordLengthChecksumMasksMapping = map[int]*big.Int{
12: big.NewInt(15),
15: big.NewInt(31),
Expand Down
5 changes: 3 additions & 2 deletions bip39_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ import (
"encoding/hex"
"testing"

"bip39/wordlists"

"github.com/tyler-smith/assert"
"go-bip39/wordlists"
)

type vector struct {
Expand Down Expand Up @@ -117,7 +118,7 @@ func TestNewEntropy(t *testing.T) {
func TestMnemonicToByteArrayForDifferentArrayLengths(t *testing.T) {
max := 1000
for i := 0; i < max; i++ {
//16, 20, 24, 28, 32
// 16, 20, 24, 28, 32
length := 16 + (i%5)*4
seed := make([]byte, length)

Expand Down
20 changes: 10 additions & 10 deletions cmd/cli/bip39.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package main

import (
"bip39"
"bufio"
"bytes"
"crypto/rand"
"encoding/base64"
"encoding/hex"
"fmt"
"go-bip39"
"math/big"
"os"
"os/user"
Expand Down Expand Up @@ -78,15 +78,15 @@ func wordHighlighting(word string, color string) string {
"magenta": 45,
"cyan": 46,
"white": 47,
//"default": 49, // currently specified color in your terminal
//"light-gray": 100,
//"light-red": 101,
//"light-green": 102,
//"light-yellow": 103,
//"light-blue": 104,
//"light-magenta": 105,
//"light-cyan": 106,
//"light-white": 107,
// "default": 49, // currently specified color in your terminal
// "light-gray": 100,
// "light-red": 101,
// "light-green": 102,
// "light-yellow": 103,
// "light-blue": 104,
// "light-magenta": 105,
// "light-cyan": 106,
// "light-white": 107,
}

// Check if the provided color string exists in the 'colors' map
Expand Down
2 changes: 1 addition & 1 deletion example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"encoding/hex"
"fmt"

"go-bip39"
"bip39"
)

func ExampleNewMnemonic() {
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module go-bip39
module bip39

go 1.21

Expand All @@ -11,6 +11,6 @@ require (
require (
github.com/cpuguy83/go-md2man/v2 v2.0.3 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
github.com/xrash/smetrics v0.0.0-20231213231151-1d8dd44e695e // indirect
golang.org/x/sys v0.15.0 // indirect
)
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ github.com/tyler-smith/assert v1.0.1 h1:AymyVNGyHOAVaDUEo0WouAMB/wwi5NdbJTDb7lsf
github.com/tyler-smith/assert v1.0.1/go.mod h1:oPc3QyIN2k0t/9Xp0sNhi3suiWuGXzIcdf/dbKQ6QGk=
github.com/urfave/cli/v2 v2.26.0 h1:3f3AMg3HpThFNT4I++TKOejZO8yU55t3JnnSr4S4QEI=
github.com/urfave/cli/v2 v2.26.0/go.mod h1:8qnjx1vcq5s2/wpsqoZFndg2CE5tNFyrTvS6SinrnYQ=
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU=
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8=
github.com/xrash/smetrics v0.0.0-20231213231151-1d8dd44e695e h1:+SOyEddqYF09QP7vr7CgJ1eti3pY9Fn3LHO1M1r/0sI=
github.com/xrash/smetrics v0.0.0-20231213231151-1d8dd44e695e/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8=
golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY=
golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc=
Expand Down

0 comments on commit 6067f45

Please sign in to comment.