]> Cypherpunks.ru repositories - gogost.git/blob - INSTALL
Mention CACert, GOPRIVATE and go.mod-replace during installation
[gogost.git] / INSTALL
1 Preferable way is to download tarball with the signature from official
2 website and, for example, run tests with benchmarks:
3
4     $ wget http://gogost.cypherpunks.ru/gogost-4.1.0.tar.xz
5     $ wget http://gogost.cypherpunks.ru/gogost-4.1.0.tar.xz.sig
6     $ gpg --verify gogost-4.1.0.tar.xz.sig gogost-4.1.0.tar.xz
7     $ xz -d < gogost-4.1.0.tar.xz | tar xf -
8     $ make -C gogost-4.1.0 all bench
9     $ echo hello world | ./gogost-4.1.0/streebog256
10     f72018189a5cfb803dbe1f2149cf554c40093d8e7f81c21e08ac5bcd09d9934d
11
12 And then you can include its source code in your project for example
13 like this:
14
15     $ mkdir -p myproj/src
16     $ cp -r gogost-4.1.0/src/go.cypherpunks.ru myproj/src
17     $ export GOPATH=$PWD/myproj
18     $ cd myproj/src
19     $ cat > main.go <<EOF
20     package main
21
22     import (
23         "encoding/hex"
24         "fmt"
25
26         "go.cypherpunks.ru/gogost/v4/gost34112012256"
27     )
28
29     func main() {
30         h := gost34112012256.New()
31         h.Write([]byte("hello world\n"))
32         fmt.Println(hex.EncodeToString(h.Sum(nil)))
33     }
34     EOF
35     $ go run main.go
36     f72018189a5cfb803dbe1f2149cf554c40093d8e7f81c21e08ac5bcd09d9934d
37
38 You have to verify downloaded tarballs integrity and authenticity to be
39 sure that you retrieved trusted and untampered software. GNU Privacy
40 Guard is used for that purpose.
41
42 For the very first time it is necessary to get signing public key and
43 import it. It is provided below, but you should check alternative
44 resources.
45
46     pub   rsa2048/0x82343436696FC85A 2016-09-13 [SC]
47           CEBD 1282 2C46 9C02 A81A  0467 8234 3436 696F C85A
48     uid   GoGOST releases <gogost at cypherpunks dot ru>
49
50     Look in PUBKEY.asc file.
51     $ gpg --auto-key-locate dane --locate-keys gogost at cypherpunks dot ru
52     $ gpg --auto-key-locate wkd --locate-keys gogost at cypherpunks dot ru
53
54 GoGOST is also go-get-able. For example to use streebog256 utility:
55
56     $ go get go.cypherpunks.ru/gogost/cmd/streebog256
57
58 go.cypherpunks.ru uses CACert.org certificate authority, that is not
59 included by default in some operating system distributions and probably
60 you have to install it in your system, because "go get" uses HTTPS
61 connections. If you have issues using either sum.golang.org or
62 proxy.golang.org, then you can disable their usage with
63 GOPRIVATE=go.cypherpunks.ru/gogost environment variable.
64
65 Also you can use "replace" feature inside your go.mod, like:
66
67     require go.cypherpunks.ru/gogost/v4 v4.1.0
68     replace go.cypherpunks.ru/gogost/v4 => /home/stargrave/gogost-4.1.0/src/go.cypherpunks.ru/gogost/v4