diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 5b97dbba7..000000000 --- a/.gitignore +++ /dev/null @@ -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 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 1ddc9b1f3..000000000 --- a/.travis.yml +++ /dev/null @@ -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 diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 3cfc9974c..000000000 --- a/LICENSE +++ /dev/null @@ -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. diff --git a/README.md b/btcec/README.md similarity index 71% rename from README.md rename to btcec/README.md index 086f05d45..fc38bfffa 100644 --- a/README.md +++ b/btcec/README.md @@ -1,10 +1,8 @@ btcec ===== -[![Build Status](https://travis-ci.org/btcsuite/btcec.png?branch=master)] -(https://travis-ci.org/btcsuite/btcec) [![Coverage Status] -(https://coveralls.io/repos/btcsuite/btcec/badge.png?branch=master)] -(https://coveralls.io/r/btcsuite/btcec?branch=master) +[![Build Status](https://travis-ci.org/btcsuite/btcd.png?branch=master)] +(https://travis-ci.org/btcsuite/btcec) 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 @@ -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 liberal ISC license. -This package is one of the core packages from btcd, an alternative full-node -implementation of bitcoin which is under active development by Conformal. -Although it was primarily written for btcd, this package has intentionally been +Although this package was primarily written for btcd, it has intentionally been designed so it can be used as a standalone package for any projects needing to use secp256k1 elliptic curve cryptography. ## Documentation -[![GoDoc](https://godoc.org/github.com/btcsuite/btcec?status.png)] -(http://godoc.org/github.com/btcsuite/btcec) +[![GoDoc](https://godoc.org/github.com/btcsuite/btcd/btcec?status.png)] +(http://godoc.org/github.com/btcsuite/btcd/btcec) Full `go doc` style documentation for the project can be viewed online without 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 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 @@ -42,12 +38,12 @@ $ go get github.com/btcsuite/btcec ## Examples * [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 parsed form raw bytes and serializing the generated 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 first parsed from raw bytes. The signature is also parsed from raw bytes. diff --git a/bench_test.go b/btcec/bench_test.go similarity index 99% rename from bench_test.go rename to btcec/bench_test.go index e40657010..429d38ee8 100644 --- a/bench_test.go +++ b/btcec/bench_test.go @@ -7,7 +7,7 @@ package btcec_test import ( "testing" - "github.com/btcsuite/btcec" + "github.com/btcsuite/btcd/btcec" ) // BenchmarkAddJacobian benchmarks the secp256k1 curve addJacobian function with diff --git a/btcec.go b/btcec/btcec.go similarity index 100% rename from btcec.go rename to btcec/btcec.go diff --git a/btcec_test.go b/btcec/btcec_test.go similarity index 99% rename from btcec_test.go rename to btcec/btcec_test.go index cf3f44222..946d1f116 100644 --- a/btcec_test.go +++ b/btcec/btcec_test.go @@ -14,7 +14,7 @@ import ( "math/big" "testing" - "github.com/btcsuite/btcec" + "github.com/btcsuite/btcd/btcec" ) // TestAddJacobian tests addition of points projected in Jacobian coordinates. diff --git a/doc.go b/btcec/doc.go similarity index 100% rename from doc.go rename to btcec/doc.go diff --git a/example_test.go b/btcec/example_test.go similarity index 98% rename from example_test.go rename to btcec/example_test.go index 69fac8619..a62d1f4f0 100644 --- a/example_test.go +++ b/btcec/example_test.go @@ -8,8 +8,8 @@ import ( "encoding/hex" "fmt" + "github.com/btcsuite/btcd/btcec" "github.com/btcsuite/btcd/wire" - "github.com/btcsuite/btcec" ) // This example demonstrates signing a message with a secp256k1 private key that diff --git a/field.go b/btcec/field.go similarity index 100% rename from field.go rename to btcec/field.go diff --git a/field_test.go b/btcec/field_test.go similarity index 99% rename from field_test.go rename to btcec/field_test.go index 73ab35612..14bb738cd 100644 --- a/field_test.go +++ b/btcec/field_test.go @@ -9,7 +9,7 @@ import ( "reflect" "testing" - "github.com/btcsuite/btcec" + "github.com/btcsuite/btcd/btcec" ) // TestSetInt ensures that setting a field value to various native integers diff --git a/genprecomps.go b/btcec/genprecomps.go similarity index 97% rename from genprecomps.go rename to btcec/genprecomps.go index 2b0e76901..96e6ba53f 100644 --- a/genprecomps.go +++ b/btcec/genprecomps.go @@ -17,7 +17,7 @@ import ( "log" "os" - "github.com/btcsuite/btcec" + "github.com/btcsuite/btcd/btcec" ) func main() { diff --git a/gensecp256k1.go b/btcec/gensecp256k1.go similarity index 100% rename from gensecp256k1.go rename to btcec/gensecp256k1.go diff --git a/internal_test.go b/btcec/internal_test.go similarity index 100% rename from internal_test.go rename to btcec/internal_test.go diff --git a/precompute.go b/btcec/precompute.go similarity index 100% rename from precompute.go rename to btcec/precompute.go diff --git a/privkey.go b/btcec/privkey.go similarity index 100% rename from privkey.go rename to btcec/privkey.go diff --git a/privkey_test.go b/btcec/privkey_test.go similarity index 97% rename from privkey_test.go rename to btcec/privkey_test.go index 058811739..898119d17 100644 --- a/privkey_test.go +++ b/btcec/privkey_test.go @@ -8,7 +8,7 @@ import ( "bytes" "testing" - "github.com/btcsuite/btcec" + "github.com/btcsuite/btcd/btcec" ) func TestPrivKeys(t *testing.T) { diff --git a/pubkey.go b/btcec/pubkey.go similarity index 100% rename from pubkey.go rename to btcec/pubkey.go diff --git a/pubkey_test.go b/btcec/pubkey_test.go similarity index 99% rename from pubkey_test.go rename to btcec/pubkey_test.go index b1237641b..374f5d554 100644 --- a/pubkey_test.go +++ b/btcec/pubkey_test.go @@ -8,7 +8,7 @@ import ( "bytes" "testing" - "github.com/btcsuite/btcec" + "github.com/btcsuite/btcd/btcec" "github.com/davecgh/go-spew/spew" ) diff --git a/secp256k1.go b/btcec/secp256k1.go similarity index 100% rename from secp256k1.go rename to btcec/secp256k1.go diff --git a/signature.go b/btcec/signature.go similarity index 100% rename from signature.go rename to btcec/signature.go diff --git a/signature_test.go b/btcec/signature_test.go similarity index 99% rename from signature_test.go rename to btcec/signature_test.go index 7b02947e5..d69790791 100644 --- a/signature_test.go +++ b/btcec/signature_test.go @@ -11,7 +11,7 @@ import ( "math/big" "testing" - "github.com/btcsuite/btcec" + "github.com/btcsuite/btcd/btcec" ) type signatureTest struct { diff --git a/cov_report.sh b/cov_report.sh deleted file mode 100644 index 307f05b76..000000000 --- a/cov_report.sh +++ /dev/null @@ -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