Skip to content
This repository was archived by the owner on Jul 15, 2018. It is now read-only.

Release/0.8.0 #127

Merged
merged 28 commits into from
Jun 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
1c9ff46
Ledger integration, WIP
cwgoes Apr 30, 2018
065c394
Fix no-Ledger testcase
cwgoes Apr 30, 2018
e25a64f
Fix testcases, all looks OK
cwgoes Apr 30, 2018
391936b
Prevent unnecessary signatures, improve error messages
cwgoes May 2, 2018
86b09b0
Bugfix
cwgoes May 3, 2018
49e03fb
Update dependency versions
cwgoes May 9, 2018
337ad8e
Update to new Ledger API in progress
cwgoes May 10, 2018
e6d0ade
Update to latest upstream, debugging information
cwgoes May 14, 2018
e534559
Update upstream Ledger code
cwgoes May 29, 2018
3186dc4
Clarify function names
cwgoes May 30, 2018
ee411da
Add ed25519, tests will fail until ed25519 verification fix
cwgoes May 30, 2018
c689f38
Implement PubKeyLedgerEd25519
cwgoes May 30, 2018
bb81e4a
Pin to an upstream revision
cwgoes May 30, 2018
21b821d
SignatureKey -> Signature
ebuchman May 30, 2018
63aac65
Remove Ledger ed25519 support, for now
cwgoes May 31, 2018
80e9752
Move TODOs to #114
cwgoes May 31, 2018
2bbad9d
Merge pull request #85 from tendermint/cwgoes/ledger-integration
cwgoes May 31, 2018
854eb32
dev version bump
ebuchman Jun 9, 2018
f6c960c
Merge branch 'develop' of https://github.com/tendermint/go-crypto int…
ebuchman Jun 9, 2018
c21f67c
Unify local and external keys in keybase interface (#117)
cwgoes Jun 10, 2018
66794a1
Move from tmlibs #213 (#115)
mossid Jun 11, 2018
e694c30
update ed25519 address scheme (#112)
ebuchman Jun 11, 2018
45a1c8a
fix tests, move encoding to encode_test.go, include an example
liamsi Jun 11, 2018
f4663e5
fix tests, bump amino version, move encoding to encode_test.go,
liamsi Jun 11, 2018
c4484c4
Merge remote-tracking branch 'remotes/origin/develop' into bucky/sig-…
liamsi Jun 11, 2018
e552d34
forgot PrivKeyLedgerSecp256k1
liamsi Jun 11, 2018
260d69f
Merge pull request #110 from tendermint/bucky/sig-name
xla Jun 11, 2018
8e31aeb
update changelog and version
liamsi Jun 12, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Changelog

## 0.8.0

BREAKING CHANGES

- update ed25519 signature scheme to truncated sha256 (#112)
- renaming registered concrete type path for ed25519 signatures (#110)

IMPROVEMENT

- SimpleProofsFromMap returns ordered keys (#115)
- return error on `privkey.Sign()` and `privkey.Pubkey()` (#117)

FEATURE

- rework API to work with local and external keys (offline, HW wallets, and Ledger) (#117)

## 0.7.0

**May 30th, 2018**
Expand Down
42 changes: 31 additions & 11 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
# go-tests = true
# unused-packages = true


[[constraint]]
name = "github.com/btcsuite/btcutil"
branch = "master"
Expand All @@ -47,7 +46,7 @@

[[constraint]]
name = "github.com/tendermint/go-amino"
version = "0.9.6"
version = "0.10.0-rc2"

[[constraint]]
name = "github.com/tendermint/tmlibs"
Expand All @@ -57,6 +56,10 @@
name = "github.com/tyler-smith/go-bip39"
branch = "master"

[[constraint]]
name = "github.com/zondax/ledger-goclient"
revision = "065cbf938a16f20335c40cfe180f9cd4955c6a5a"

[prune]
go-tests = true
unused-packages = true
6 changes: 4 additions & 2 deletions amino.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@ func RegisterAmino(cdc *amino.Codec) {
"tendermint/PrivKeyEd25519", nil)
cdc.RegisterConcrete(PrivKeySecp256k1{},
"tendermint/PrivKeySecp256k1", nil)
cdc.RegisterConcrete(PrivKeyLedgerSecp256k1{},
"tendermint/PrivKeyLedgerSecp256k1", nil)

cdc.RegisterInterface((*Signature)(nil), nil)
cdc.RegisterConcrete(SignatureEd25519{},
"tendermint/SignatureKeyEd25519", nil)
"tendermint/SignatureEd25519", nil)
cdc.RegisterConcrete(SignatureSecp256k1{},
"tendermint/SignatureKeySecp256k1", nil)
"tendermint/SignatureSecp256k1", nil)
}
20 changes: 18 additions & 2 deletions encode_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package crypto

import (
"os"
"testing"

"github.com/stretchr/testify/assert"
Expand Down Expand Up @@ -41,6 +42,19 @@ func checkAminoJSON(t *testing.T, src interface{}, dst interface{}, isNil bool)
require.Nil(t, err, "%+v", err)
}

func ExamplePrintRegisteredTypes() {
cdc.PrintTypes(os.Stdout)
// Output: | Type | Name | Prefix | Length | Notes |
//| ---- | ---- | ------ | ----- | ------ |
//| PubKeyEd25519 | tendermint/PubKeyEd25519 | 0x1624DE64 | 0x20 | |
//| PubKeySecp256k1 | tendermint/PubKeySecp256k1 | 0xEB5AE987 | 0x21 | |
//| PrivKeyEd25519 | tendermint/PrivKeyEd25519 | 0xA3288910 | 0x40 | |
//| PrivKeySecp256k1 | tendermint/PrivKeySecp256k1 | 0xE1B0F79B | 0x20 | |
//| PrivKeyLedgerSecp256k1 | tendermint/PrivKeyLedgerSecp256k1 | 0x10CAB393 | variable | |
//| SignatureEd25519 | tendermint/SignatureEd25519 | 0x2031EA53 | 0x40 | |
//| SignatureSecp256k1 | tendermint/SignatureSecp256k1 | 0x7FC4A495 | variable | |
}

func TestKeyEncodings(t *testing.T) {
cases := []struct {
privKey PrivKey
Expand Down Expand Up @@ -69,14 +83,16 @@ func TestKeyEncodings(t *testing.T) {

// Check (de/en)codings of Signatures.
var sig1, sig2, sig3 Signature
sig1 = tc.privKey.Sign([]byte("something"))
sig1, err := tc.privKey.Sign([]byte("something"))
assert.NoError(t, err)
checkAminoBinary(t, sig1, &sig2, -1) // Siganture size changes for Secp anyways.
assert.EqualValues(t, sig1, sig2)
checkAminoJSON(t, sig1, &sig3, false) // TODO also check Prefix bytes.
assert.EqualValues(t, sig1, sig3)

// Check (de/en)codings of PubKeys.
pubKey := tc.privKey.PubKey()
pubKey, err := tc.privKey.PubKey()
assert.NoError(t, err)
var pub2, pub3 PubKey
checkAminoBinary(t, pubKey, &pub2, tc.pubSize)
assert.EqualValues(t, pubKey, pub2)
Expand Down
Loading