aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/crypto_test.go
Commit message (Collapse)AuthorAgeFilesLines
* crypto: replace ToECDSAPub with error-checking func UnmarshalPubkey (#16932)Felix Lange2018-06-121-1/+30
| | | | | | ToECDSAPub was unsafe because it returned a non-nil key with nil X, Y in case of invalid input. This change replaces ToECDSAPub with UnmarshalPubkey across the codebase.
* crypto: fix golint warnings (#16710)kiel barry2018-05-091-4/+4
|
* crypto: fix error check in toECDSA (#15632)Felix Lange2017-12-121-0/+9
| | | | | | | | With this change, key, err := crypto.HexToECDSA("000000...") returns nil key and an error instead of a non-nil key with nil X and Y inside. Issue found by @guidovranken.
* crypto: add DecompressPubkey, VerifySignature (#15615)Felix Lange2017-12-061-7/+1
| | | | | | | We need those operations for p2p/enr. Also upgrade github.com/btcsuite/btcd/btcec to the latest version and improve BenchmarkSha3. The benchmark printed extra output that confused tools like benchstat and ignored N.
* accounts/keystore, crypto: don't enforce key checks on existing keyfilesPéter Szilágyi2017-06-011-1/+1
|
* crypto: add btcec fallback for sign/recover without cgo (#3680)Felix Lange2017-02-181-28/+8
| | | | | | | | | | | * vendor: add github.com/btcsuite/btcd/btcec * crypto: add btcec fallback for sign/recover without cgo This commit adds a non-cgo fallback implementation of secp256k1 operations. * crypto, core/vm: remove wrappers for sha256, ripemd160
* crypto/secp256k1: update to github.com/bitcoin-core/secp256k1 @ 9d560f9 (#3544)Felix Lange2017-01-131-8/+0
| | | | | - Use defined constants instead of hard-coding their integer value. - Allocate secp256k1 structs on the C stack instead of converting []byte - Remove dead code
* all: fix issues reported by honnef.co/go/simple/cmd/gosimpleFelix Lange2017-01-071-1/+1
|
* accounts, core, crypto, internal: use normalised V during signature handling ↵Péter Szilágyi2017-01-051-50/+24
| | | | | | | | | (#3455) To address increasing complexity in code that handles signatures, this PR discards all notion of "different" signature types at the library level. Both the crypto and accounts package is reduced to only be able to produce plain canonical secp256k1 signatures. This makes the crpyto APIs much cleaner, simpler and harder to abuse.
* internal/ethapi: add personal_sign and fix eth_sign to hash message (#2940)bas-vk2016-10-291-6/+29
| | | | | | | | | | | | | | | | | | | | This commit includes several API changes: - The behavior of eth_sign is changed. It now accepts an arbitrary message, prepends the well-known string \x19Ethereum Signed Message:\n<length of message> hashes the result using keccak256 and calculates the signature of the hash. This breaks backwards compatability! - personal_sign(hash, address [, password]) is added. It has the same semantics as eth_sign but also accepts a password. The private key used to sign the hash is temporarily unlocked in the scope of the request. - personal_recover(message, signature) is added and returns the address for the account that created a signature.
* all: Rename crypto.Sha3{,Hash}() to crypto.Keccak256{,Hash}()Ricardo Catalinas Jiménez2016-02-221-5/+5
| | | | As we aren't really using the standarized SHA-3
* parmas, crypto, core, core/vm: homestead consensus protocol changesGustav Simonsson2016-02-181-1/+1
| | | | | | | | * change gas cost for contract creating txs * invalidate signature with s value greater than secp256k1 N / 2 * OOG contract creation if not enough gas to store code * new difficulty adjustment algorithm * new DELEGATECALL op code
* crypto, crypto/ecies, crypto/secp256k1: libsecp256k1 scalar multGustav Simonsson2015-11-301-4/+4
| | | | thanks to Felix Lange (fjl) for help with design & impl
* crypto: correct sig validation, add more unit testsGustav Simonsson2015-09-221-14/+167
|
* all: fix license headers one more timeFelix Lange2015-07-241-1/+1
| | | | I forgot to update one instance of "go-ethereum" in commit 3f047be5a.
* all: update license headers to distiguish GPL/LGPLFelix Lange2015-07-231-4/+4
| | | | | All code outside of cmd/ is licensed as LGPL. The headers now reflect this by calling the whole work "the go-ethereum library".
* all: update license informationFelix Lange2015-07-071-0/+16
|
* crypto: fix Sha3Hash and add a test for itFelix Lange2015-03-171-1/+7
|
* Moved ethutil => commonobscuren2015-03-161-2/+2
|
* crypto: make it easier to run Sha3 on multiple inputsFelix Lange2015-02-061-1/+1
| | | | | crypto.Sha3(append(foo, bar)) --> crypto.Sha3(foo, bar) crypto.Sha3([]byte{}) --> crypto.Sha3()
* Pad private key when signing & length check for hashes in signobscuren2015-01-231-1/+13
|
* Moved `obscuren` secp256k1-goobscuren2015-01-221-1/+1
|
* Added 0 key proof errorobscuren2015-01-191-0/+13
| | | | | Private key \x00\x00...\x00 returns the _exact_ same public key as \x11 \x11...\x11. Currently investigating.
* pre-powobscuren2015-01-121-0/+13
|
* ethcrypto => cryptoobscuren2014-10-311-0/+36