Commit Graph

42 Commits

Author SHA1 Message Date
Felix Lange 3f047be5aa all: update license headers to distiguish GPL/LGPL
All code outside of cmd/ is licensed as LGPL. The headers
now reflect this by calling the whole work "the go-ethereum library".
2015-07-22 18:51:45 +02:00
Felix Lange ea54283b30 all: update license information 2015-07-07 14:12:44 +02:00
zelig fc17a527bc fix account ordering
* chronological order of creation
* new naming scheme keystore/UTC--<created_at UTC ISO8601>-<address hex>
* KeyStore2 -> KeyStore
* backward compatibility
* refactor keyStore methods
2015-07-03 03:19:32 +01:00
Gustav Simonsson d23ec6c419 Change keystore to version 3
* Change password protection crypto in keystore to version 3
* Update KeyStoreTests/basic_tests.json
* Add support for PBKDF2 with HMAC-SHA256
* Change MAC and encryption key to avoid unnecessary hashing
* Add tests for test vectors in new wiki page defining version 3
* Add tests for new keystore tests in ethereum/tests repo
* Move JSON loading util to common for use in both tests and
  crypto packages
* Add backwards compatibility with key store version 1
2015-06-24 06:03:23 +02:00
obscuren 0f51ee6c88 crypto: return common.Address rather than raw bytes 2015-06-04 19:28:39 +02:00
Gustav Simonsson edbd902a1b Initialise curve N value in package init 2015-06-03 14:44:29 +02:00
Gustav Simonsson 32e1b104f8 Add EC signature validations before call to libsecp256k1 2015-06-01 21:06:52 +02:00
Gustav Simonsson e389585f1f Change default keystore dir 2015-05-12 18:33:04 +02:00
Gustav Simonsson 2c1b0ff17e Update key store to new spec but keep address field for now
* Also fix address types post-rebase
2015-05-12 17:22:17 +02:00
Gustav Simonsson da9fe951da Use common.Address type for accounts.Address 2015-05-12 17:19:39 +02:00
Gustav Simonsson 6b23094cff Improve key store passphrase crypto
* Change MAC-then-Encrypt to Encrypt-then-MAC
* Change AES256 to AES128
* Use first 16 bytes of KDF derived key for AES and
  remaining 16 for MAC
2015-05-12 17:18:30 +02:00
Gustav Simonsson 34c94d5fcd Add loading of block test privkey if present 2015-04-27 20:30:26 +02:00
Felix Lange 4907d28967 crypto: update {Load,Save}ECDSA comments to mention hex encoding 2015-04-19 01:33:00 +02:00
Bas van Kervel ef393da933 removed utility function and implemented hex conversation in crypto functions 2015-04-09 10:59:37 +02:00
Bas van Kervel b3a3fdf9a4 Support for import/export hex encoded keys, closes #635 2015-04-08 23:03:47 +02:00
Gustav Simonsson 3f306f63d4 Forward and log EC recover err and remove dup pubkey len check 2015-04-07 12:48:19 +02:00
obscuren 61c5edcb57 Cleanup. 2015-03-29 15:02:49 +02:00
zelig 4ec38e3932 common: remove WriteFile and ReadAllFile (use ioutil instead) 2015-03-26 19:00:18 +00:00
zelig c4ea921876 import/export accounts
- cli: add passwordfile flag
- cli: change unlock flag only takes account
- cli: with unlock you are prompted for password or use passfile with password flag
- cli: unlockAccount used in normal client start (run) and accountExport
- cli: getPassword used in accountCreate and accountImport
- accounts: Manager.Import, Manager.Export
- crypto: SaveECDSA (to complement LoadECDSA) to save to file
- crypto: NewKeyFromECDSA added (used in accountImport and New = generated constructor)
2015-03-26 19:00:18 +00:00
Felix Lange ee7202fa00 Merge remote-tracking branch 'ethereum/conversion' into conversion 2015-03-17 12:01:40 +01:00
obscuren 515d9432fc converted vm 2015-03-17 11:19:23 +01:00
Felix Lange ad78db4d62 crypto: fix Sha3Hash and add a test for it 2015-03-17 01:32:35 +01:00
Felix Lange 64490897f3 crypto: add Sha3Hash 2015-03-16 17:27:24 +01:00
obscuren b523441361 Moved ethutil => common 2015-03-16 11:27:38 +01:00
Felix Lange 119bea22aa crypto: switch to golang.org/x/crypto
code.google.com/p/go.crypto is deprecated and will cause
problems in future versions of Go.
2015-02-17 13:05:58 +01:00
obscuren 84f7c966f7 Moved ECIES to repo & added secondary title for webview
* ECIES moved from obscuren to ethereum
* Added html META[name=badge] to reflect menuItem.secondaryTitle
2015-02-14 00:25:47 +01:00
Felix Lange 0c7df37351 crypto: add key loading functions 2015-02-10 12:29:50 +01:00
Felix Lange 410b35e913 crypto: make it easier to run Sha3 on multiple inputs
crypto.Sha3(append(foo, bar)) --> crypto.Sha3(foo, bar)
crypto.Sha3([]byte{}) --> crypto.Sha3()
2015-02-06 00:00:36 +01:00
obscuren c48644490f Fixed whisper pub key bug
* Unrecoverable messages would cause segfault when recovering invalid
  pub key
2015-01-30 13:24:20 +01:00
Gustav Simonsson 8d9752a557 Address pull request comments
* Use crypto.Sign instead of directly calling secp256k1 lib
* Rename UserAccount to Account and Addr to Address (for consistency)
* Change AccountManager.Sign to take ptr to Account instead of
  address byte array
* Simplify copying of Accounts in Accounts()
* PubkeyToAddress and GetEntropyCSPRNG now exported
2015-01-28 05:12:57 +01:00
Gustav Simonsson 512ffa2bf4 Add accounts package and refactor key stores
* Add initial UserAccount and AccountManager structs
* Add NewAccount, Sign and Accounts functions
* Refactor key stores to use key address as main identifier
  while keeping the UUID.
* Use key address as file/dir names instead of UUID
2015-01-26 04:30:17 +01:00
obscuren a125b0fbc3 Merge branch 'import_presale_keys' of https://github.com/Gustav-Simonsson/go-ethereum into Gustav-Simonsson-import_presale_keys
Conflicts:
	crypto/crypto.go
2015-01-22 22:42:39 +01:00
obscuren 0dfe511370 Use curve params instead of hardcoded 32 bytes 2015-01-22 18:15:11 +01:00
obscuren d4cc2d3503 Pad private key when signing & length check for hashes in sign 2015-01-22 18:12:05 +01:00
obscuren 67f9783e6a Moved `obscuren` secp256k1-go 2015-01-22 00:35:00 +01:00
obscuren 6eaa404187 Moved sha3 from `obscuren` 2015-01-22 00:25:00 +01:00
Gustav Simonsson 8af42d42da CamelCase aesCBCDecrypt 2015-01-21 19:08:05 +01:00
Gustav Simonsson 1f8290ca44 Add ImportPreSaleKey
* ImportPreSaleKey takes a KeyStore, a presale key JSON (e.g. file content)
  and a password string. It stores the key in the given key store.
* Refactored common AES decryption and moved some functions to crypto.go
2015-01-21 16:35:43 +01:00
obscuren 06e76422b5 Added length checkes 2014-12-12 22:24:04 +01:00
obscuren 0f5c6c5e2d Changed new methods to use ecdsa package for pub prv keys 2014-12-10 14:17:10 +01:00
obscuren 87adff7e18 Added Encrypt & Decrypt using the ECIES w/ tests 2014-12-10 00:03:21 +01:00
obscuren fd9da72536 ethcrypto => crypto 2014-10-31 12:37:43 +01:00