diff options
author | Antoine GIRARD <sapk@users.noreply.github.com> | 2017-06-14 02:43:43 +0200 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2017-06-14 08:43:43 +0800 |
commit | 274149dd14909d4ba87f25f8e5160f51ca5f7265 (patch) | |
tree | 37157530111d5bf90efcc914fbc8c8e7cdff3db9 /vendor/github.com/keybase/go-crypto/curve25519/doc.go | |
parent | 5e92b82ac632043f622117419ad04e57e9c029f3 (diff) | |
download | gitea-274149dd14909d4ba87f25f8e5160f51ca5f7265.tar.gz gitea-274149dd14909d4ba87f25f8e5160f51ca5f7265.zip |
Switch to keybase go-crypto (for some elliptic curve key) + test (#1925)
* Switch to keybase go-crypto (for some elliptic curve key) + test
* Use assert.NoError
and add a little more context to failing test description
* Use assert.(No)Error everywhere 🌈
and assert.Error in place of .Nil/.NotNil
Diffstat (limited to 'vendor/github.com/keybase/go-crypto/curve25519/doc.go')
-rw-r--r-- | vendor/github.com/keybase/go-crypto/curve25519/doc.go | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/vendor/github.com/keybase/go-crypto/curve25519/doc.go b/vendor/github.com/keybase/go-crypto/curve25519/doc.go new file mode 100644 index 0000000000..f7db9c1ce8 --- /dev/null +++ b/vendor/github.com/keybase/go-crypto/curve25519/doc.go @@ -0,0 +1,23 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package curve25519 provides an implementation of scalar multiplication on +// the elliptic curve known as curve25519. See http://cr.yp.to/ecdh.html +package curve25519 + +// basePoint is the x coordinate of the generator of the curve. +var basePoint = [32]byte{9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} + +// ScalarMult sets dst to the product in*base where dst and base are the x +// coordinates of group points and all values are in little-endian form. +func ScalarMult(dst, in, base *[32]byte) { + scalarMult(dst, in, base) +} + +// ScalarBaseMult sets dst to the product in*base where dst and base are the x +// coordinates of group points, base is the standard generator and all values +// are in little-endian form. +func ScalarBaseMult(dst, in *[32]byte) { + ScalarMult(dst, in, &basePoint) +} |