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