Commit graph

9 commits

Author SHA1 Message Date
Lars Hesel Christensen b4214fc93c Add tests for new encryption API on the manager
100% coverage on selectCryptoKey, Encrypt, Decrypt.
2014-11-10 21:11:23 -06:00
Dave Collins e3769bcec6 Add the new ErrInvalidKeyType to the stringer map.
Also add it to the stringer test.
2014-10-31 10:20:58 -05:00
Dave Collins 732ffe4ed1 Address a couple of nits with recent En(De)crypt.
This commit adds comments about the specific crypto key types, moves the
selectCryptoKey function before the Encrypt/Decrypt functions that call it
to be more consistent with the rest of the code base, and slightly
modifies the verbiage of the comment.
2014-10-31 10:09:44 -05:00
Lars Hesel Christensen 7f7f6f33cb Expose functions needed from the voting pool package 2014-10-31 11:28:26 +01:00
Dave Collins fb7e87b1ef Move new addrmgr Options type and default to top.
Default values near the top of the file is preferrable so they are more
easily spotted.
2014-10-29 02:27:38 -05:00
Lars Hesel Christensen 402fcf0dd0 Make scrypt parameters overridable/optional 2014-10-28 23:46:28 -05:00
Dave Collins 966b6b0ec7 Unexport the cryptoKey type.
The crypto key type unsed in the manager is not needed outside of the
package.  Also, rather than having the newCryptoKey func return the
specific cryptoKey type, make it return the EncryptorDecryptor interface.
This will allow it to be overridden with another type that implements the
interface from the tests.
2014-10-13 16:19:12 -05:00
Guilherme Salgado 85f4856230 Allow injection of crypto keys into the manager.
Useful to test error conditions.

Also provide a new function that wraps snacl.GenerateCryptoKey(),
defined as a variable so that it can be replaced in tests.
2014-10-13 16:19:11 -05:00
Dave Collins d0938d817f Provide new wallet address manager package.
This commit implements a new secure, scalable, hierarchical deterministic
wallet address manager package.

The following is an overview of features:

- BIP0032 hierarchical deterministic keys
- BIP0043/BIP0044 multi-account hierarchy
- Strong focus on security:
  - Fully encrypted database including public information such as
    addresses as well as private information such as private keys and
    scripts needed to redeem pay-to-script-hash transactions
  - Hardened against memory scraping through the use of actively clearing
    private material from memory when locked
  - Different crypto keys used for public, private, and script data
  - Ability for different passphrases for public and private data
  - Scrypt-based key derivation
  - NaCl-based secretbox cryptography (XSalsa20 and Poly1305)
  - Multi-tier scalable key design to allow instant password changes
    regardless of the number of addresses stored
- Import WIF keys
- Import pay-to-script-hash scripts for things such as multi-signature
  transactions
- Ability to export a watching-only version which does not contain any
  private key material
- Programmatically detectable errors, including encapsulation of errors
  from packages it relies on
- Address synchronization capabilities

This commit only provides the implementation package.  It does not
include integration into to the existing wallet code base or conversion of
existing addresses.  That functionality will be provided by future
commits.
2014-10-13 16:19:09 -05:00