aboutsummaryrefslogtreecommitdiffstats
path: root/ethcrypto
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-10-08 18:06:39 +0800
committerobscuren <geffobscura@gmail.com>2014-10-08 18:06:39 +0800
commit9d86a49a7327199c01977f3372c8adf748252c32 (patch)
treea07141b5910df83e6284713149f9173c31ce247b /ethcrypto
parentf3196c915a6f8ddde1d2e178ad419a114b608b91 (diff)
downloadgo-tangerine-9d86a49a7327199c01977f3372c8adf748252c32.tar
go-tangerine-9d86a49a7327199c01977f3372c8adf748252c32.tar.gz
go-tangerine-9d86a49a7327199c01977f3372c8adf748252c32.tar.bz2
go-tangerine-9d86a49a7327199c01977f3372c8adf748252c32.tar.lz
go-tangerine-9d86a49a7327199c01977f3372c8adf748252c32.tar.xz
go-tangerine-9d86a49a7327199c01977f3372c8adf748252c32.tar.zst
go-tangerine-9d86a49a7327199c01977f3372c8adf748252c32.zip
Renamed Sha3Bin to Sha3
Diffstat (limited to 'ethcrypto')
-rw-r--r--ethcrypto/crypto.go5
-rw-r--r--ethcrypto/keypair.go5
2 files changed, 5 insertions, 5 deletions
diff --git a/ethcrypto/crypto.go b/ethcrypto/crypto.go
index 624c5169f..ebc8b171b 100644
--- a/ethcrypto/crypto.go
+++ b/ethcrypto/crypto.go
@@ -1,7 +1,6 @@
package ethcrypto
import (
- //"code.google.com/p/go.crypto/sha3"
"crypto/sha256"
"code.google.com/p/go.crypto/ripemd160"
@@ -12,7 +11,7 @@ import (
)
// TODO refactor, remove (bin)
-func Sha3Bin(data []byte) []byte {
+func Sha3(data []byte) []byte {
d := sha3.NewKeccak256()
d.Write(data)
@@ -21,7 +20,7 @@ func Sha3Bin(data []byte) []byte {
// Creates an ethereum address given the bytes and the nonce
func CreateAddress(b []byte, nonce uint64) []byte {
- return Sha3Bin(ethutil.NewValue([]interface{}{b, nonce}).Encode())[12:]
+ return Sha3(ethutil.NewValue([]interface{}{b, nonce}).Encode())[12:]
}
func Sha256(data []byte) []byte {
diff --git a/ethcrypto/keypair.go b/ethcrypto/keypair.go
index 18fa5b788..ebb982306 100644
--- a/ethcrypto/keypair.go
+++ b/ethcrypto/keypair.go
@@ -1,9 +1,10 @@
package ethcrypto
import (
+ "strings"
+
"github.com/ethereum/eth-go/ethutil"
"github.com/obscuren/secp256k1-go"
- "strings"
)
type KeyPair struct {
@@ -32,7 +33,7 @@ func NewKeyPairFromSec(seckey []byte) (*KeyPair, error) {
func (k *KeyPair) Address() []byte {
if k.address == nil {
- k.address = Sha3Bin(k.PublicKey[1:])[12:]
+ k.address = Sha3(k.PublicKey[1:])[12:]
}
return k.address
}