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