]> Cypherpunks.ru repositories - gogost.git/blob - www.texi
Download link for 5.14.1 release
[gogost.git] / www.texi
1 \input texinfo
2 @documentencoding UTF-8
3 @settitle GoGOST
4
5 @copying
6 Copyright @copyright{} 2015-2022 @email{stargrave@@stargrave.org, Sergey Matveev}
7 @end copying
8
9 @node Top
10 @top GoGOST
11
12 Pure Go GOST cryptographic functions library.
13 GOST is GOvernment STandard of Russian Federation (and Soviet Union).
14 It is
15 @url{https://www.gnu.org/philosophy/pragmatic.html, copylefted}
16 @url{https://www.gnu.org/philosophy/free-sw.html, free software}:
17 licenced under @url{https://www.gnu.org/licenses/gpl-3.0.html, GPLv3}.
18 You can read about GOST algorithms @url{http://www.gost.cypherpunks.ru/, more}.
19
20 Currently supported algorithms are:
21
22 @itemize
23 @item GOST 28147-89 (@url{https://tools.ietf.org/html/rfc5830.html, RFC 5830})
24     block cipher with ECB, CNT (CTR), CFB, MAC,
25     CBC (@url{https://tools.ietf.org/html/rfc4357.html, RFC 4357})
26     modes of operation
27 @item various 28147-89-related S-boxes included
28 @item GOST R 34.11-94 hash function
29     (@url{https://tools.ietf.org/html/rfc5831.html, RFC 5831})
30 @item GOST R 34.11-2012 Стрибог (Streebog) hash function
31     (@url{https://tools.ietf.org/html/rfc6986.html, RFC 6986})
32 @item GOST R 34.10-2001
33     (@url{https://tools.ietf.org/html/rfc5832.html, RFC 5832})
34     public key signature function
35 @item GOST R 34.10-2012
36     (@url{https://tools.ietf.org/html/rfc7091.html, RFC 7091})
37     public key signature function
38 @item various 34.10 curve parameters included
39 @item Coordinates conversion from twisted Edwards to Weierstrass
40     form and vice versa
41 @item VKO GOST R 34.10-2001 key agreement function
42     (@url{https://tools.ietf.org/html/rfc4357.html, RFC 4357})
43 @item VKO GOST R 34.10-2012 key agreement function
44     (@url{https://tools.ietf.org/html/rfc7836.html, RFC 7836})
45 @item @code{KDF_GOSTR3411_2012_256} KDF function
46     (@url{https://tools.ietf.org/html/rfc7836.html, RFC 7836})
47 @item GOST R 34.12-2015 128-bit block cipher Кузнечик (Kuznechik)
48     (@url{https://tools.ietf.org/html/rfc7801.html, RFC 7801})
49 @item GOST R 34.12-2015 64-bit block cipher Магма (Magma)
50 @item GOST R 34.13-2015 padding methods
51 @item MGM AEAD mode for 64 and 128 bit ciphers
52     (@url{https://tools.ietf.org/html/rfc9058.html, RFC 9058})
53 @item TLSTREE keyscheduling function
54 @item ESPTREE/IKETREE (IKE* is the same as ESP*) keyscheduling function
55 @item @code{PRF_IPSEC_PRFPLUS_GOSTR3411_2012_@{256,512@}} and generic
56     @code{prf+} functions (Р 50.1.111-2016 with IKEv2
57     @url{https://tools.ietf.org/html/rfc5831.html, RFC 7296})
58 @end itemize
59
60 Probably you could be interested in
61 @url{//www.gostls13.cypherpunks.ru/, Go's support of GOST TLS 1.3}.
62
63 Example 34.10-2012-256 keypair generation, signing and verifying:
64
65 @verbatim
66 import (
67     "crypto/rand"
68     "io"
69     "go.cypherpunks.ru/gogost/v5/gost3410"
70     "go.cypherpunks.ru/gogost/v5/gost34112012256"
71 )
72 func main() {
73     data := []byte("data to be signed")
74     hasher := gost34112012256.New()
75     _, err := hasher.Write(data)
76     dgst := hasher.Sum(nil)
77     curve := gost3410.CurveIdtc26gost341012256paramSetB()
78     prvRaw := make([]byte, 32)
79     _, err = io.ReadFull(rand.Reader, prvRaw)
80     prv, err := gost3410.NewPrivateKey(curve, prvRaw)
81     pub, err := prv.PublicKey()
82     pubRaw := pub.Raw()
83     sign, err := prv.Sign(rand.Reader, dgst, nil)
84     pub, err = gost3410.NewPublicKey(curve, pubRaw)
85     isValid, err := pub.VerifyDigest(dgst, sign)
86     if !isValid { panic("signature is invalid") }
87 }
88 @end verbatim
89
90 Please send questions, bug reports and patches to
91 @url{http://lists.cypherpunks.ru/gost.html, gost}
92 mailing list. Announcements also go to this mailing list.
93
94 @insertcopying
95
96 @include faq.texi
97 @include news.texi
98 @include install.texi
99
100 @bye