]> Cypherpunks.ru repositories - gogost.git/blob - install.texi
Example 34.10-2012-256 signing/verifying
[gogost.git] / install.texi
1 @node Download
2 @unnumbered Download
3
4 @set VERSION 4.2.4
5
6 Preferable way is to download tarball with the signature from
7 website and, for example, run tests with benchmarks:
8
9 @example
10 $ [fetch|wget] http://www.gogost.cypherpunks.ru/gogost-@value{VERSION}.tar.xz
11 $ [fetch|wget] http://www.gogost.cypherpunks.ru/gogost-@value{VERSION}.tar.xz.sig
12 $ gpg --verify gogost-@value{VERSION}.tar.xz.sig gogost-@value{VERSION}.tar.xz
13 $ xz --decompress --stdout gogost-@value{VERSION}.tar.xz | tar xf -
14 $ cd gogost-@value{VERSION}
15 $ redo bench
16 $ redo all
17 $ echo hello world | ./streebog256
18 f72018189a5cfb803dbe1f2149cf554c40093d8e7f81c21e08ac5bcd09d9934d
19 @end example
20
21 It uses @url{http://cr.yp.to/redo.html, redo} build system for that
22 examples. You can use either dozen of various implementations, or at
23 least minimalistic POSIX shell @code{apenwarr/do}:
24
25 @example
26 $ [fetch|wget] https://github.com/apenwarr/redo/raw/master/minimal/do
27 $ mv do redo ; chmod +x redo
28 @end example
29
30 @include download.texi
31
32 And then you can include its source code in your project for example
33 like this:
34
35 @example
36 $ mkdir -p myproj/src
37 $ cp -r gogost-@value{VERSION}/src/go.cypherpunks.ru myproj/src
38 $ export GOPATH=$PWD/myproj
39 $ cd myproj/src
40 $ cat > main.go <<EOF
41 package main
42
43 import (
44     "encoding/hex"
45     "fmt"
46
47     "go.cypherpunks.ru/gogost/v4/gost34112012256"
48 )
49
50 func main() @{
51     h := gost34112012256.New()
52     h.Write([]byte("hello world\n"))
53     fmt.Println(hex.EncodeToString(h.Sum(nil)))
54 @}
55 EOF
56 $ go run main.go
57 f72018189a5cfb803dbe1f2149cf554c40093d8e7f81c21e08ac5bcd09d9934d
58 @end example
59
60 You @strong{have to} verify downloaded tarballs integrity and
61 authenticity to be sure that you retrieved trusted and untampered
62 software. @url{https://www.gnupg.org/, GNU Privacy Guard} is used
63 for that purpose.
64
65 For the very first time it is necessary to get signing public key and
66 import it. It is provided below, but you should check alternative
67 resources.
68
69 @verbatim
70 pub   rsa2048/0x82343436696FC85A 2016-09-13 [SC]
71       CEBD 1282 2C46 9C02 A81A  0467 8234 3436 696F C85A
72 uid   GoGOST releases <gogost at cypherpunks dot ru>
73 @end verbatim
74
75 @itemize
76
77 @item @url{https://lists.cypherpunks.ru/mailman/listinfo/gost, gost} maillist
78
79 @item
80 @example
81 $ gpg --auto-key-locate dane --locate-keys gogost at cypherpunks dot ru
82 $ gpg --auto-key-locate wkd --locate-keys gogost at cypherpunks dot ru
83 @end example
84
85 @item
86 @verbatiminclude PUBKEY.asc
87
88 @end itemize
89
90 GoGOST is also @command{go get}-able. For example to use
91 @command{streebog256} utility:
92
93 @example
94 $ go get go.cypherpunks.ru/gogost/cmd/streebog256
95 @end example
96
97 @code{go.cypherpunks.ru} uses @url{http://www.ca.cypherpunks.ru/, ca.cypherpunks.ru}
98 certificate authority. If you have issues using either
99 @code{sum.golang.org} or @code{proxy.golang.org}, then you can disable
100 their usage with @env{GOPRIVATE=go.cypherpunks.ru/gogost} environment
101 variable.
102
103 Also you can use @code{replace} feature inside your @file{go.mod}, like:
104
105 @example
106 require go.cypherpunks.ru/gogost/v4 v@value{VERSION}
107 replace go.cypherpunks.ru/gogost/v4 => /home/stargrave/gogost-@value{VERSION}/src/go.cypherpunks.ru/gogost/v4
108 @end example
109
110 You can obtain development source code with
111 @command{git clone git://git.cypherpunks.ru/gogost.git}.