]> Cypherpunks.ru repositories - gogost.git/blob - install.texi
Actualize installation documentation
[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.zst
9 $ [fetch|wget] http://www.gogost.cypherpunks.ru/gogost-@value{VERSION}.tar.zst.sig
10 $ gpg --verify gogost-@value{VERSION}.tar.zst.sig gogost-@value{VERSION}.tar.zst
11 $ zstd --decompress --stdout gogost-@value{VERSION}.tar.zst | tar xf -
12 $ cd gogost-@value{VERSION}
13 $ redo 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/vendor/go.cypherpunks.ru/gogost
31 $ mv gogost-@value{VERSION} myproj/vendor/go.cypherpunks.ru/gogost/v5
32 $ cd myproj
33 $ cat > main.go <<EOF
34 package main
35
36 import (
37     "encoding/hex"
38     "fmt"
39
40     "go.cypherpunks.ru/gogost/v5/gost34112012256"
41 )
42
43 func main() @{
44     h := gost34112012256.New()
45     h.Write([]byte("hello world\n"))
46     fmt.Println(hex.EncodeToString(h.Sum(nil)))
47 @}
48 EOF
49 $ go run main.go
50 f72018189a5cfb803dbe1f2149cf554c40093d8e7f81c21e08ac5bcd09d9934d
51 @end example
52
53 You @strong{have to} verify downloaded tarballs integrity and
54 authenticity to be sure that you retrieved trusted and untampered
55 software. @url{https://www.gnupg.org/, GNU Privacy Guard} is used
56 for that purpose.
57
58 For the very first time it is necessary to get signing public key and
59 import it. It is provided below, but you should check alternative
60 resources.
61
62 @verbatim
63 pub   rsa2048/0x82343436696FC85A 2016-09-13 [SC]
64       CEBD 1282 2C46 9C02 A81A  0467 8234 3436 696F C85A
65 uid   GoGOST releases <gogost at cypherpunks dot ru>
66 @end verbatim
67
68 @itemize
69
70 @item @url{http://lists.cypherpunks.ru/gost.html, gost} maillist
71
72 @item
73 @example
74 $ gpg --auto-key-locate dane --locate-keys gogost at cypherpunks dot ru
75 $ gpg --auto-key-locate  wkd --locate-keys gogost at cypherpunks dot ru
76 @end example
77
78 @item
79 @verbatiminclude PUBKEY.asc
80
81 @end itemize
82
83 GoGOST is also @command{go get}-able. For example to install
84 @command{streebog256} utility:
85
86 @example
87 $ go install go.cypherpunks.ru/gogost/v5/cmd/streebog256@@latest
88 @end example
89
90 @code{go.cypherpunks.ru} uses @code{ca.cypherpunks.ru} X.509 CA
91 authority, that may complicate installation:
92
93 @itemize
94
95 @item Go's default @code{proxy.golang.org} and @code{sum.golang.org}
96 services won't be able to verify @code{go.cypherpunks.ru}'s TLS
97 authenticity, because there are no common trust anchors. You can skip
98 their usage by setting @env{$GOPRIVATE=go.cypherpunks.ru}.
99
100 @item You can (temporarily) override CA certificate bundle during installation:
101
102 @example
103 $ [fetch|wget] http://www.ca.cypherpunks.ru/cert.pem
104 $ [fetch|wget] http://www.ca.cypherpunks.ru/cert.pem.asc
105 $ gpg --auto-key-locate dane --locate-keys stargrave at stargrave dot org
106 $ gpg --auto-key-locate  wkd --locate-keys stargrave at gnupg dot net
107 $ gpg --verify cert.pem.asc
108 $ SSL_CERT_FILE=`pwd`/cert.pem GIT_SSL_CAINFO=`pwd`/cert.pem go get \
109     go.cypherpunks.ru/gogost/v5
110 @end example
111
112 @item You can unpack tarball somewhere and use @code{replace} command in
113 your local @file{go.mod}:
114
115 @example
116 require go.cypherpunks.ru/gogost/v5 v@value{VERSION}
117 replace go.cypherpunks.ru/gogost/v5 => /path/to/gogost-@value{VERSION}
118 @end example
119
120 @end itemize
121
122 You can obtain development source code with
123 @command{git clone git://git.cypherpunks.ru/gogost.git}
124 (also you can use @url{https://git.cypherpunks.ru/gogost.git}).