]> Cypherpunks.ru repositories - gogost.git/commitdiff
Download link for 5.14.1 release master
authorSergey Matveev <stargrave@stargrave.org>
Mon, 22 Apr 2024 14:25:30 +0000 (17:25 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Mon, 22 Apr 2024 14:25:30 +0000 (17:25 +0300)
download.texi
gogost.go
gost34112012512/pbkdf2_test.go [new file with mode: 0644]
install.texi
integrity.texi
makedist
news.texi
version

index 9bb2b9b2abe51f450d2ad236b98ab8d3c9d690ad..b51ae2711d9df9ed2dbe617b26308e9cc8bd232a 100644 (file)
@@ -1,6 +1,12 @@
 @multitable {XXXXX} {XXXX-XX-XX} {XXXX KiB} {meta4 tar pgp ssh}
 @headitem Version @tab Date @tab Size @tab Tarball
 
+@item @ref{Release 5.14.1, 5.14.1} @tab 2024-04-22 @tab 67 KiB @tab
+@url{gogost-5.14.1.tar.zst.meta4, meta4}
+@url{gogost-5.14.1.tar.zst, tar}
+@url{gogost-5.14.1.tar.zst.asc, pgp}
+@url{gogost-5.14.1.tar.zst.sig, ssh}
+
 @item @ref{Release 5.14.0, 5.14.0} @tab 2023-12-08 @tab 66 KiB @tab
 @url{gogost-5.14.0.tar.zst.meta4, meta4}
 @url{gogost-5.14.0.tar.zst, tar}
index b7d04d9692dc67496d71f12904ccdc1b0fae3fa9..f33164bec209502fb9c39b5133a185345046ac41 100644 (file)
--- a/gogost.go
+++ b/gogost.go
@@ -1,4 +1,4 @@
 // Pure Go GOST cryptographic functions library.
 package gogost
 
-const Version = "5.13.0"
+const Version = "5.14.1"
diff --git a/gost34112012512/pbkdf2_test.go b/gost34112012512/pbkdf2_test.go
new file mode 100644 (file)
index 0000000..ab66356
--- /dev/null
@@ -0,0 +1,157 @@
+// GoGOST -- Pure Go GOST cryptographic functions library
+// Copyright (C) 2015-2024 Sergey Matveev <stargrave@stargrave.org>
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, version 3 of the License.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+package gost34112012512
+
+import (
+       "bytes"
+       "testing"
+
+       "golang.org/x/crypto/pbkdf2"
+)
+
+// Test vectors from http://tc26.ru/.../R_50.1.111-2016.pdf
+
+func Test1(t *testing.T) {
+       if !bytes.Equal(pbkdf2.Key(
+               []byte("password"),
+               []byte("salt"),
+               1,
+               64,
+               New,
+       ), []byte{
+               0x64, 0x77, 0x0a, 0xf7, 0xf7, 0x48, 0xc3, 0xb1,
+               0xc9, 0xac, 0x83, 0x1d, 0xbc, 0xfd, 0x85, 0xc2,
+               0x61, 0x11, 0xb3, 0x0a, 0x8a, 0x65, 0x7d, 0xdc,
+               0x30, 0x56, 0xb8, 0x0c, 0xa7, 0x3e, 0x04, 0x0d,
+               0x28, 0x54, 0xfd, 0x36, 0x81, 0x1f, 0x6d, 0x82,
+               0x5c, 0xc4, 0xab, 0x66, 0xec, 0x0a, 0x68, 0xa4,
+               0x90, 0xa9, 0xe5, 0xcf, 0x51, 0x56, 0xb3, 0xa2,
+               0xb7, 0xee, 0xcd, 0xdb, 0xf9, 0xa1, 0x6b, 0x47,
+       }) {
+               t.FailNow()
+       }
+}
+
+func Test2(t *testing.T) {
+       if !bytes.Equal(pbkdf2.Key(
+               []byte("password"),
+               []byte("salt"),
+               2,
+               64,
+               New,
+       ), []byte{
+               0x5a, 0x58, 0x5b, 0xaf, 0xdf, 0xbb, 0x6e, 0x88,
+               0x30, 0xd6, 0xd6, 0x8a, 0xa3, 0xb4, 0x3a, 0xc0,
+               0x0d, 0x2e, 0x4a, 0xeb, 0xce, 0x01, 0xc9, 0xb3,
+               0x1c, 0x2c, 0xae, 0xd5, 0x6f, 0x02, 0x36, 0xd4,
+               0xd3, 0x4b, 0x2b, 0x8f, 0xbd, 0x2c, 0x4e, 0x89,
+               0xd5, 0x4d, 0x46, 0xf5, 0x0e, 0x47, 0xd4, 0x5b,
+               0xba, 0xc3, 0x01, 0x57, 0x17, 0x43, 0x11, 0x9e,
+               0x8d, 0x3c, 0x42, 0xba, 0x66, 0xd3, 0x48, 0xde,
+       }) {
+               t.FailNow()
+       }
+}
+
+func Test4096(t *testing.T) {
+       if !bytes.Equal(pbkdf2.Key(
+               []byte("password"),
+               []byte("salt"),
+               4096,
+               64,
+               New,
+       ), []byte{
+               0xe5, 0x2d, 0xeb, 0x9a, 0x2d, 0x2a, 0xaf, 0xf4,
+               0xe2, 0xac, 0x9d, 0x47, 0xa4, 0x1f, 0x34, 0xc2,
+               0x03, 0x76, 0x59, 0x1c, 0x67, 0x80, 0x7f, 0x04,
+               0x77, 0xe3, 0x25, 0x49, 0xdc, 0x34, 0x1b, 0xc7,
+               0x86, 0x7c, 0x09, 0x84, 0x1b, 0x6d, 0x58, 0xe2,
+               0x9d, 0x03, 0x47, 0xc9, 0x96, 0x30, 0x1d, 0x55,
+               0xdf, 0x0d, 0x34, 0xe4, 0x7c, 0xf6, 0x8f, 0x4e,
+               0x3c, 0x2c, 0xda, 0xf1, 0xd9, 0xab, 0x86, 0xc3,
+       }) {
+               t.FailNow()
+       }
+}
+
+func TestWithZero(t *testing.T) {
+       if !bytes.Equal(pbkdf2.Key(
+               []byte("pass\x00word"),
+               []byte("sa\x00lt"),
+               4096,
+               64,
+               New,
+       ), []byte{
+               0x50, 0xdf, 0x06, 0x28, 0x85, 0xb6, 0x98, 0x01,
+               0xa3, 0xc1, 0x02, 0x48, 0xeb, 0x0a, 0x27, 0xab,
+               0x6e, 0x52, 0x2f, 0xfe, 0xb2, 0x0c, 0x99, 0x1c,
+               0x66, 0x0f, 0x00, 0x14, 0x75, 0xd7, 0x3a, 0x4e,
+               0x16, 0x7f, 0x78, 0x2c, 0x18, 0xe9, 0x7e, 0x92,
+               0x97, 0x6d, 0x9c, 0x1d, 0x97, 0x08, 0x31, 0xea,
+               0x78, 0xcc, 0xb8, 0x79, 0xf6, 0x70, 0x68, 0xcd,
+               0xac, 0x19, 0x10, 0x74, 0x08, 0x44, 0xe8, 0x30,
+       }) {
+               t.FailNow()
+       }
+}
+
+func Test100(t *testing.T) {
+       if !bytes.Equal(pbkdf2.Key(
+               []byte("passwordPASSWORDpassword"),
+               []byte("saltSALTsaltSALTsaltSALTsaltSALTsalt"),
+               4096,
+               100,
+               New,
+       ), []byte{
+               0xb2, 0xd8, 0xf1, 0x24, 0x5f, 0xc4, 0xd2, 0x92,
+               0x74, 0x80, 0x20, 0x57, 0xe4, 0xb5, 0x4e, 0x0a,
+               0x07, 0x53, 0xaa, 0x22, 0xfc, 0x53, 0x76, 0x0b,
+               0x30, 0x1c, 0xf0, 0x08, 0x67, 0x9e, 0x58, 0xfe,
+               0x4b, 0xee, 0x9a, 0xdd, 0xca, 0xe9, 0x9b, 0xa2,
+               0xb0, 0xb2, 0x0f, 0x43, 0x1a, 0x9c, 0x5e, 0x50,
+               0xf3, 0x95, 0xc8, 0x93, 0x87, 0xd0, 0x94, 0x5a,
+               0xed, 0xec, 0xa6, 0xeb, 0x40, 0x15, 0xdf, 0xc2,
+               0xbd, 0x24, 0x21, 0xee, 0x9b, 0xb7, 0x11, 0x83,
+               0xba, 0x88, 0x2c, 0xee, 0xbf, 0xef, 0x25, 0x9f,
+               0x33, 0xf9, 0xe2, 0x7d, 0xc6, 0x17, 0x8c, 0xb8,
+               0x9d, 0xc3, 0x74, 0x28, 0xcf, 0x9c, 0xc5, 0x2a,
+               0x2b, 0xaa, 0x2d, 0x3a,
+       }) {
+               t.FailNow()
+       }
+}
+
+func Test16777216(t *testing.T) {
+       t.Skip("takes too long")
+       if !bytes.Equal(pbkdf2.Key(
+               []byte("password"),
+               []byte("salt"),
+               16777216,
+               64,
+               New,
+       ), []byte{
+               0x49, 0xe4, 0x84, 0x3b, 0xba, 0x76, 0xe3, 0x00,
+               0xaf, 0xe2, 0x4c, 0x4d, 0x23, 0xdc, 0x73, 0x92,
+               0xde, 0xf1, 0x2f, 0x2c, 0x0e, 0x24, 0x41, 0x72,
+               0x36, 0x7c, 0xd7, 0x0a, 0x89, 0x82, 0xac, 0x36,
+               0x1a, 0xdb, 0x60, 0x1c, 0x7e, 0x2a, 0x31, 0x4e,
+               0x8c, 0xb7, 0xb1, 0xe9, 0xdf, 0x84, 0x0e, 0x36,
+               0xab, 0x56, 0x15, 0xbe, 0x5d, 0x74, 0x2b, 0x6c,
+               0xf2, 0x03, 0xfb, 0x55, 0xfd, 0xc4, 0x80, 0x71,
+       }) {
+               t.FailNow()
+       }
+}
index 891ac9dcfd0dac81a3793378984f9fb7f28333db..3e72eb0f8adc65e86cbf3f8fdc276a67d7be8a49 100644 (file)
@@ -8,7 +8,7 @@ website and, for example, run tests with benchmarks:
 $ [fetch|wget] http://www.gogost.cypherpunks.ru/gogost-@value{VERSION}.tar.zst
 $ [fetch|wget] http://www.gogost.cypherpunks.ru/gogost-@value{VERSION}.tar.zst.@{asc,sig@}
 [verify signature]
-$ zstd -d gogost-@value{VERSION}.tar.zst | tar xf -
+$ tar xf gogost-@value{VERSION}.tar.zst
 $ cd gogost-@value{VERSION}
 $ go build -mod=vendor -o streebog256 ./cmd/streebog256
 $ echo hello world | ./streebog256
@@ -24,7 +24,7 @@ like this:
 $ mkdir -p myproj/vendor/go.cypherpunks.ru/gogost
 $ mv gogost-@value{VERSION} myproj/vendor/go.cypherpunks.ru/gogost/v5
 $ cd myproj
-$ cat > main.go <<EOF
+$ cat >main.go <<EOF
 package main
 
 import (
index 7e283ea7ef2874e569f41df2e76af9cdcf0fda87..3127ab857e3ade6b5acf20ddf6420759f6b89d7b 100644 (file)
@@ -28,7 +28,7 @@ $ gpg --auto-key-locate  wkd --locate-keys gogost at cypherpunks dot ru
 
 @example
 $ ssh-keygen -Y verify -f PUBKEY-SSH.pub -I gogost@@cypherpunks.ru -n file \
-    -s gogost-@value{VERSION}.tar.zst.sig < gogost-@value{VERSION}.tar.zst
+    -s gogost-@value{VERSION}.tar.zst.sig <gogost-@value{VERSION}.tar.zst
 @end example
 
 @end table
index 48bb6e8167627b252d81a77645f59e615b37b1e4..0dd75f5db6e1f8c90cf642b1980e09920c4d71b8 100755 (executable)
--- a/makedist
+++ b/makedist
@@ -9,10 +9,10 @@ release=$1
 git clone . $tmp/gogost-$release
 cd $tmp/gogost-$release
 git checkout v$release
-./version > VERSION
+./version >VERSION
 go mod vendor
 
-cat > download.texi <<EOF
+cat >download.texi <<EOF
 You can obtain releases source code prepared tarballs on
 @url{http://www.gogost.cypherpunks.ru/}.
 EOF
@@ -24,7 +24,7 @@ mkinfo() {
 }
 
 texi=$(mktemp)
-cat > $texi <<EOF
+cat >$texi <<EOF
 \input texinfo
 @documentencoding UTF-8
 @settitle INSTALL
@@ -33,7 +33,7 @@ cat > $texi <<EOF
 EOF
 mkinfo --output INSTALL $texi
 
-cat > $texi <<EOF
+cat >$texi <<EOF
 \input texinfo
 @documentencoding UTF-8
 @settitle NEWS
@@ -42,7 +42,7 @@ cat > $texi <<EOF
 EOF
 mkinfo --output NEWS $texi
 
-cat > $texi <<EOF
+cat >$texi <<EOF
 \input texinfo
 @documentencoding UTF-8
 @settitle FAQ
@@ -63,14 +63,14 @@ chmod +x bench
 
 cd ..
 tar cvf gogost-"$release".tar --uid=0 --gid=0 --numeric-owner gogost-"$release"
-zstd -19 -v gogost-"$release".tar
+zstd -22 --ultra -v gogost-"$release".tar
 tarball=gogost-"$release".tar.zst
 ssh-keygen -Y sign -f ~/.ssh/sign/gogost@cypherpunks.ru -n file $tarball
 gpg --armor --detach-sign --sign --local-user 82343436696FC85A $tarball
-meta4-create -fn "$tarball" -mtime "$tarball" \
+meta4ra-create -fn "$tarball" -mtime "$tarball" \
     -sig-pgp "$tarball".asc -sig-ssh "$tarball".sig \
     http://www.gogost.cypherpunks.ru/"$tarball" \
-    http://y.www.gogost.cypherpunks.ru/"$tarball" < "$tarball" > "$tarball".meta4
+    http://y.www.gogost.cypherpunks.ru/"$tarball" <"$tarball" >"$tarball".meta4
 
 size=$(( $(stat -f %z $tarball) / 1024 ))
 release_date=$(date "+%Y-%m-%d")
@@ -104,7 +104,7 @@ GoGOST'es home page is: http://www.gogost.cypherpunks.ru/
 Source code and its signature for that version can be found here:
 
     http://www.gogost.cypherpunks.ru/gogost-${release}.tar.zst ($size KiB)
-    http://www.gogost.cypherpunks.ru/gogost-${release}.tar.zst.asc
+    http://www.gogost.cypherpunks.ru/gogost-${release}.tar.zst.{asc,sig}
 
 OpenPGP key: CEBD 1282 2C46 9C02 A81A  0467 8234 3436 696F C85A
              GoGOST releases <gogost@cypherpunks.ru>
@@ -135,7 +135,7 @@ GoGOST это свободное программное обеспечение 
 Исходный код и его подпись для этой версии могут быть найдены здесь:
 
     http://www.gogost.cypherpunks.ru/gogost-${release}.tar.zst ($size KiB)
-    http://www.gogost.cypherpunks.ru/gogost-${release}.tar.zst.asc
+    http://www.gogost.cypherpunks.ru/gogost-${release}.tar.zst.{asc,sig}
 
 OpenPGP ключ: CEBD 1282 2C46 9C02 A81A  0467 8234 3436 696F C85A
               GoGOST releases <gogost@cypherpunks.ru>
index fdca6926bd4b8d2060c689daed395a16579756a2..bd73cc2d3d409770ca4a356ae46eee819fcf4370 100644 (file)
--- a/news.texi
+++ b/news.texi
@@ -3,6 +3,13 @@
 
 @table @strong
 
+@anchor{Release 5.14.1}
+@item 5.14.1
+    @itemize
+    @item Forgotten @code{Version} raise
+    @item Streebog-512 PBKDF2 test vectors
+    @end itemize
+
 @anchor{Release 5.14.0}
 @item 5.14.0
 28147-89 and CryptoPro key wrapping support
diff --git a/version b/version
index 0775f20518a6a6c0630e8af2d58c9f809905d9bd..5fa0ac910d725e8a8e185248f0aab681679676e5 100755 (executable)
--- a/version
+++ b/version
@@ -1,3 +1,3 @@
 #!/bin/sh -e
 
-exec perl -ne 'print "$1\n" if /Version.*"(.*)"$/' < "$(realpath -- $(dirname "$0"))"/gogost.go
+exec perl -ne 'print "$1\n" if /Version.*"(.*)"$/' <"$(realpath -- $(dirname "$0"))"/gogost.go