mirror of
https://github.com/LBRYFoundation/lbcd.git
synced 2025-08-23 17:47:24 +00:00
Import btcec repo into btcec directory.
This commit is contained in:
parent
857a78fcdf
commit
87968edb1d
23 changed files with 17 additions and 126 deletions
28
.gitignore
vendored
28
.gitignore
vendored
|
@ -1,28 +0,0 @@
|
||||||
# Temp files
|
|
||||||
*~
|
|
||||||
|
|
||||||
# Log files
|
|
||||||
*.log
|
|
||||||
|
|
||||||
# Compiled Object files, Static and Dynamic libs (Shared Objects)
|
|
||||||
*.o
|
|
||||||
*.a
|
|
||||||
*.so
|
|
||||||
|
|
||||||
# Folders
|
|
||||||
_obj
|
|
||||||
_test
|
|
||||||
|
|
||||||
# Architecture specific extensions/prefixes
|
|
||||||
*.[568vq]
|
|
||||||
[568vq].out
|
|
||||||
|
|
||||||
*.cgo1.go
|
|
||||||
*.cgo2.c
|
|
||||||
_cgo_defun.c
|
|
||||||
_cgo_gotypes.go
|
|
||||||
_cgo_export.*
|
|
||||||
|
|
||||||
_testmain.go
|
|
||||||
|
|
||||||
*.exe
|
|
11
.travis.yml
11
.travis.yml
|
@ -1,11 +0,0 @@
|
||||||
language: go
|
|
||||||
go: release
|
|
||||||
install:
|
|
||||||
- go get -d -t -v ./...
|
|
||||||
- go get -v golang.org/x/tools/cmd/cover
|
|
||||||
script:
|
|
||||||
- go test -v -covermode=count -coverprofile=profile.cov
|
|
||||||
after_success:
|
|
||||||
- go get -v github.com/mattn/goveralls
|
|
||||||
- export PATH=$PATH:$HOME/gopath/bin
|
|
||||||
- goveralls -coverprofile=profile.cov -service=travis-ci
|
|
49
LICENSE
49
LICENSE
|
@ -1,49 +0,0 @@
|
||||||
Copyright (c) 2009 The Go Authors. All rights reserved.
|
|
||||||
Copyright (c) 2011 ThePiachu. All rights reserved.
|
|
||||||
Copyright (c) 2013-2014 Conformal Systems LLC. All rights reserved.
|
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
|
||||||
modification, are permitted provided that the following conditions are
|
|
||||||
met:
|
|
||||||
|
|
||||||
* Redistributions of source code must retain the above copyright
|
|
||||||
notice, this list of conditions and the following disclaimer.
|
|
||||||
* Redistributions in binary form must reproduce the above
|
|
||||||
copyright notice, this list of conditions and the following disclaimer
|
|
||||||
in the documentation and/or other materials provided with the
|
|
||||||
distribution.
|
|
||||||
* Neither the name of Google Inc. nor the names of its
|
|
||||||
contributors may be used to endorse or promote products derived from
|
|
||||||
this software without specific prior written permission.
|
|
||||||
* The name of ThePiachu may not be used to endorse or promote products
|
|
||||||
derived from this software without specific prior written permission.
|
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
||||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
||||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
||||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
||||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
-------------------
|
|
||||||
|
|
||||||
ISC License
|
|
||||||
|
|
||||||
Copyright (c) 2013 Conformal Systems LLC.
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
||||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
|
@ -1,10 +1,8 @@
|
||||||
btcec
|
btcec
|
||||||
=====
|
=====
|
||||||
|
|
||||||
[]
|
[]
|
||||||
(https://travis-ci.org/btcsuite/btcec) [![Coverage Status]
|
(https://travis-ci.org/btcsuite/btcec)
|
||||||
(https://coveralls.io/repos/btcsuite/btcec/badge.png?branch=master)]
|
|
||||||
(https://coveralls.io/r/btcsuite/btcec?branch=master)
|
|
||||||
|
|
||||||
Package btcec implements elliptic curve cryptography needed for working with
|
Package btcec implements elliptic curve cryptography needed for working with
|
||||||
Bitcoin (secp256k1 only for now). It is designed so that it may be used with the
|
Bitcoin (secp256k1 only for now). It is designed so that it may be used with the
|
||||||
|
@ -14,24 +12,22 @@ on work from ThePiachu which is licensed under the same terms as Go, but it has
|
||||||
signficantly diverged since then. The Conformal original is licensed under the
|
signficantly diverged since then. The Conformal original is licensed under the
|
||||||
liberal ISC license.
|
liberal ISC license.
|
||||||
|
|
||||||
This package is one of the core packages from btcd, an alternative full-node
|
Although this package was primarily written for btcd, it has intentionally been
|
||||||
implementation of bitcoin which is under active development by Conformal.
|
|
||||||
Although it was primarily written for btcd, this package has intentionally been
|
|
||||||
designed so it can be used as a standalone package for any projects needing to
|
designed so it can be used as a standalone package for any projects needing to
|
||||||
use secp256k1 elliptic curve cryptography.
|
use secp256k1 elliptic curve cryptography.
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
[]
|
[]
|
||||||
(http://godoc.org/github.com/btcsuite/btcec)
|
(http://godoc.org/github.com/btcsuite/btcd/btcec)
|
||||||
|
|
||||||
Full `go doc` style documentation for the project can be viewed online without
|
Full `go doc` style documentation for the project can be viewed online without
|
||||||
installing this package by using the GoDoc site
|
installing this package by using the GoDoc site
|
||||||
[here](http://godoc.org/github.com/btcsuite/btcec).
|
[here](http://godoc.org/github.com/btcsuite/btcd/btcec).
|
||||||
|
|
||||||
You can also view the documentation locally once the package is installed with
|
You can also view the documentation locally once the package is installed with
|
||||||
the `godoc` tool by running `godoc -http=":6060"` and pointing your browser to
|
the `godoc` tool by running `godoc -http=":6060"` and pointing your browser to
|
||||||
http://localhost:6060/pkg/github.com/btcsuite/btcec
|
http://localhost:6060/pkg/github.com/btcsuite/btcd/btcec
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
|
@ -42,12 +38,12 @@ $ go get github.com/btcsuite/btcec
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
* [Sign Message]
|
* [Sign Message]
|
||||||
(http://godoc.org/github.com/btcsuite/btcec#example-package--SignMessage)
|
(http://godoc.org/github.com/btcsuite/btcd/btcec#example-package--SignMessage)
|
||||||
Demonstrates signing a message with a secp256k1 private key that is first
|
Demonstrates signing a message with a secp256k1 private key that is first
|
||||||
parsed form raw bytes and serializing the generated signature.
|
parsed form raw bytes and serializing the generated signature.
|
||||||
|
|
||||||
* [Verify Signature]
|
* [Verify Signature]
|
||||||
(http://godoc.org/github.com/btcsuite/btcec#example-package--VerifySignature)
|
(http://godoc.org/github.com/btcsuite/btcd/btcec#example-package--VerifySignature)
|
||||||
Demonstrates verifying a secp256k1 signature against a public key that is
|
Demonstrates verifying a secp256k1 signature against a public key that is
|
||||||
first parsed from raw bytes. The signature is also parsed from raw bytes.
|
first parsed from raw bytes. The signature is also parsed from raw bytes.
|
||||||
|
|
|
@ -7,7 +7,7 @@ package btcec_test
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/btcsuite/btcec"
|
"github.com/btcsuite/btcd/btcec"
|
||||||
)
|
)
|
||||||
|
|
||||||
// BenchmarkAddJacobian benchmarks the secp256k1 curve addJacobian function with
|
// BenchmarkAddJacobian benchmarks the secp256k1 curve addJacobian function with
|
|
@ -14,7 +14,7 @@ import (
|
||||||
"math/big"
|
"math/big"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/btcsuite/btcec"
|
"github.com/btcsuite/btcd/btcec"
|
||||||
)
|
)
|
||||||
|
|
||||||
// TestAddJacobian tests addition of points projected in Jacobian coordinates.
|
// TestAddJacobian tests addition of points projected in Jacobian coordinates.
|
|
@ -8,8 +8,8 @@ import (
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/btcsuite/btcd/btcec"
|
||||||
"github.com/btcsuite/btcd/wire"
|
"github.com/btcsuite/btcd/wire"
|
||||||
"github.com/btcsuite/btcec"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// This example demonstrates signing a message with a secp256k1 private key that
|
// This example demonstrates signing a message with a secp256k1 private key that
|
|
@ -9,7 +9,7 @@ import (
|
||||||
"reflect"
|
"reflect"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/btcsuite/btcec"
|
"github.com/btcsuite/btcd/btcec"
|
||||||
)
|
)
|
||||||
|
|
||||||
// TestSetInt ensures that setting a field value to various native integers
|
// TestSetInt ensures that setting a field value to various native integers
|
|
@ -17,7 +17,7 @@ import (
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/btcsuite/btcec"
|
"github.com/btcsuite/btcd/btcec"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
|
@ -8,7 +8,7 @@ import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/btcsuite/btcec"
|
"github.com/btcsuite/btcd/btcec"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestPrivKeys(t *testing.T) {
|
func TestPrivKeys(t *testing.T) {
|
|
@ -8,7 +8,7 @@ import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/btcsuite/btcec"
|
"github.com/btcsuite/btcd/btcec"
|
||||||
"github.com/davecgh/go-spew/spew"
|
"github.com/davecgh/go-spew/spew"
|
||||||
)
|
)
|
||||||
|
|
|
@ -11,7 +11,7 @@ import (
|
||||||
"math/big"
|
"math/big"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/btcsuite/btcec"
|
"github.com/btcsuite/btcd/btcec"
|
||||||
)
|
)
|
||||||
|
|
||||||
type signatureTest struct {
|
type signatureTest struct {
|
|
@ -1,17 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# This script uses gocov to generate a test coverage report.
|
|
||||||
# The gocov tool my be obtained with the following command:
|
|
||||||
# go get github.com/axw/gocov/gocov
|
|
||||||
#
|
|
||||||
# It will be installed to $GOPATH/bin, so ensure that location is in your $PATH.
|
|
||||||
|
|
||||||
# Check for gocov.
|
|
||||||
type gocov >/dev/null 2>&1
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
echo >&2 "This script requires the gocov tool."
|
|
||||||
echo >&2 "You may obtain it with the following command:"
|
|
||||||
echo >&2 "go get github.com/axw/gocov/gocov"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
gocov test | gocov report
|
|
Loading…
Add table
Reference in a new issue