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