From 760f49298dd70c3b1e4ba75f9704444b4d94ed1d Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Sun, 10 Jan 2021 15:40:09 +0300 Subject: [PATCH] BLAKE3 instead of BLAKE2b --- dep.go | 9 +++------ doc/news.texi | 17 ++++++++++------- go.mod | 6 +++--- go.sum | 21 ++++++++------------- makedist.sh | 22 ++++++++++++---------- 5 files changed, 36 insertions(+), 39 deletions(-) diff --git a/dep.go b/dep.go index df5ae27..0c5b634 100644 --- a/dep.go +++ b/dep.go @@ -30,8 +30,8 @@ import ( "path/filepath" "go.cypherpunks.ru/recfile" - "golang.org/x/crypto/blake2b" "golang.org/x/sys/unix" + "lukechampine.com/blake3" ) var DirPrefix string @@ -85,11 +85,8 @@ func fileCtime(fd *os.File) (string, error) { } func fileHash(fd *os.File) (string, error) { - h, err := blake2b.New256(nil) - if err != nil { - panic(err) - } - if _, err = io.Copy(h, bufio.NewReader(fd)); err != nil { + h := blake3.New(32, nil) + if _, err := io.Copy(h, bufio.NewReader(fd)); err != nil { return "", err } return hex.EncodeToString(h.Sum(nil)), nil diff --git a/doc/news.texi b/doc/news.texi index de7f880..516e380 100644 --- a/doc/news.texi +++ b/doc/news.texi @@ -1,16 +1,19 @@ @node News @unnumbered News -@table @strong - @anchor{Release 0.11.0} -@item 0.11.0 +@section Release 0.11.0 +@itemize +@item Previously @env{REDO_JOBS} overrided even explicitly specified @option{-j} option. Fix that behaviour -- command line options must precede environment variables. +@item @url{https://github.com/BLAKE3-team/BLAKE3, BLAKE3} replaces + BLAKE2p hashing algorithm for even better performance. +@end itemize @anchor{Release 0.10.0} -@item 0.10.0 - Initial tarballed release. - -@end table +@section Release 0.10.0 +@itemize +@item Initial tarballed release. +@end itemize diff --git a/go.mod b/go.mod index 1c1f782..bf4f3c0 100644 --- a/go.mod +++ b/go.mod @@ -3,9 +3,9 @@ module go.cypherpunks.ru/goredo go 1.12 require ( - go.cypherpunks.ru/recfile v0.4.0 - go.cypherpunks.ru/tai64n v0.2.0 - golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad + go.cypherpunks.ru/recfile v0.4.1 + go.cypherpunks.ru/tai64n v0.2.1 golang.org/x/sys v0.0.0-20210108172913-0df2131ae363 golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf + lukechampine.com/blake3 v1.1.4 ) diff --git a/go.sum b/go.sum index afb0f01..cef3b94 100644 --- a/go.sum +++ b/go.sum @@ -1,18 +1,13 @@ -go.cypherpunks.ru/recfile v0.4.0 h1:BvNraS8PPVGKvcttbSfdOmTUsmLRke6OuN4z6SeKQNk= -go.cypherpunks.ru/recfile v0.4.0/go.mod h1:p1ZUMeyQQbQg+ICtKH3+Zt59QLI0tCZYZj/75Vp1buk= -go.cypherpunks.ru/tai64n v0.2.0 h1:ox04T0m9wVngTb5tDwrPyifukr01c6iJXHHJldlMQu8= -go.cypherpunks.ru/tai64n v0.2.0/go.mod h1:mjuUq/ZQAOEKvzAAl25RIrN6JExWA4fRkOs7o7OVvYE= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad h1:DN0cp81fZ3njFcrLCytUHRSUkqBjfTo4Tx9RJTWs0EY= -golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +github.com/klauspost/cpuid v1.3.1 h1:5JNjFYYQrZeKRJ0734q51WCEEn2huer72Dc7K+R/b6s= +github.com/klauspost/cpuid v1.3.1/go.mod h1:bYW4mA6ZgKPob1/Dlai2LviZJO7KGI3uoWLd42rAQw4= +go.cypherpunks.ru/recfile v0.4.1 h1:vfO8X4W3Mg3DJZ/046qftXd5+b/TWG2ifuKU8Whlai0= +go.cypherpunks.ru/recfile v0.4.1/go.mod h1:p1ZUMeyQQbQg+ICtKH3+Zt59QLI0tCZYZj/75Vp1buk= +go.cypherpunks.ru/tai64n v0.2.1 h1:ppT9Unbay2/sHVAniOHo80Nzo6jTttSVUuzltSndZ98= +go.cypherpunks.ru/tai64n v0.2.1/go.mod h1:nwHLv0Eu0/PVHEKkFO5MWNzoaIVjEUxM9BWxMyXe3zM= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210108172913-0df2131ae363 h1:wHn06sgWHMO1VsQ8F+KzDJx/JzqfsNLnc+oEi07qD7s= golang.org/x/sys v0.0.0-20210108172913-0df2131ae363/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/term v0.0.0-20201117132131-f5c789dd3221 h1:/ZHdbVpdR/jk3g30/d4yUL0JU9kksj8+F/bnQUVLGDM= -golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf h1:MZ2shdL+ZM/XzY3ZGOnh4Nlpnxz5GSOhOmtHo3iPU6M= golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +lukechampine.com/blake3 v1.1.4 h1:cVl4fhMGfCaCFrs4sBb8R/iEMeL0g4CfQp/sAHBDxOI= +lukechampine.com/blake3 v1.1.4/go.mod h1:hE8RpzdO8ttZ7446CXEwDP1eu2V4z7stv0Urj1El20g= diff --git a/makedist.sh b/makedist.sh index e891eca..a3aa488 100755 --- a/makedist.sh +++ b/makedist.sh @@ -62,9 +62,9 @@ mv *.go go.* src/$mod_name mods=" go.cypherpunks.ru/recfile go.cypherpunks.ru/tai64n -golang.org/x/crypto golang.org/x/sys golang.org/x/term +lukechampine.com/blake3 " for mod in $mods; do @@ -75,18 +75,17 @@ for mod in $mods; do chmod -R +w src/$mod done +for mod in github.com/klauspost/cpuid; do + mod_path=$(sed -n "s#^\($mod\) \(.*\) h1:.*\$#\1@\2#p" src/$mod_name/go.sum | sed /go.mod/d | sort -n -r | sed -n 1p) + [ -n "$mod_path" ] + mkdir -p src/$mod + ( cd $GOPATH/pkg/mod/$mod_path ; tar cf - --exclude ".git*" * ) | tar xfC - src/$mod + chmod -R +w src/$mod +done + cat > $tmp/includes <