Commit Graph

11 Commits

Author SHA1 Message Date
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
Gustav Simonsson
8c056aebe1 Set both key generation and ECDSA nonce to use mixed entropy
* Move random entropy functions to new package randentropy
* Add function to get n bytes entropy where up to first 32
  bytes are mixed with OS entropy sources
2015-02-10 22:49:28 +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
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
Gustav Simonsson
d48140cab3 Address pull request comments
* Further simplify "constructor" function's allocation of structs
* Fix formatting
2015-01-19 22:12:22 +01:00
Gustav Simonsson
3cf038f300 Address pull request comments
* Allocate with composite literal instead of new
* Remove check of number of bytes read from rand
2015-01-19 20:24:30 +01:00
Gustav Simonsson
9caf32befe Update code comments 2015-01-15 19:58:38 +01:00
Gustav Simonsson
47d3b3dd58 Address pull request comments
* Remove flags field from key struct
* Change JSON struct fields from string to []byte
* Change GenerateNewKey API to take io.Reader for random source
* Remove mixing entropy source function
* Use testing Fatal in tests
2015-01-15 19:40:10 +01:00
Gustav Simonsson
a1c2749380 Address pull request comments
* Simplify scrypt constants with const block
* Add key store constructors and make their types private
* Simplify key store and file namings to be less Java Enterprise™
* Change test error logging to use t.Error(err)
* Reduce number of naked returns (just like my ex-gf)
* Simplify file reading path code
2015-01-15 19:40:10 +01:00