Fix spelling in comments: heirarchy → hierarchy

This commit is contained in:
Andreas Schildbach 2017-11-24 13:23:27 +01:00
parent 3cc652858c
commit 61e5d714c3
4 changed files with 6 additions and 6 deletions

View file

@ -58,7 +58,7 @@ public class DeterministicHierarchy {
} }
/** /**
* Inserts a key into the heirarchy. Used during deserialization: you normally don't need this. Keys must be * Inserts a key into the hierarchy. Used during deserialization: you normally don't need this. Keys must be
* inserted in order. * inserted in order.
*/ */
public final void putKey(DeterministicKey key) { public final void putKey(DeterministicKey key) {

View file

@ -355,13 +355,13 @@ public class DeterministicKey extends ECKey {
public ECDSASignature sign(Sha256Hash input, @Nullable KeyParameter aesKey) throws KeyCrypterException { public ECDSASignature sign(Sha256Hash input, @Nullable KeyParameter aesKey) throws KeyCrypterException {
if (isEncrypted()) { if (isEncrypted()) {
// If the key is encrypted, ECKey.sign will decrypt it first before rerunning sign. Decryption walks the // If the key is encrypted, ECKey.sign will decrypt it first before rerunning sign. Decryption walks the
// key heirarchy to find the private key (see below), so, we can just run the inherited method. // key hierarchy to find the private key (see below), so, we can just run the inherited method.
return super.sign(input, aesKey); return super.sign(input, aesKey);
} else { } else {
// If it's not encrypted, derive the private via the parents. // If it's not encrypted, derive the private via the parents.
final BigInteger privateKey = findOrDerivePrivateKey(); final BigInteger privateKey = findOrDerivePrivateKey();
if (privateKey == null) { if (privateKey == null) {
// This key is a part of a public-key only heirarchy and cannot be used for signing // This key is a part of a public-key only hierarchy and cannot be used for signing
throw new MissingPrivateKeyException(); throw new MissingPrivateKeyException();
} }
return super.doSign(input, privateKey); return super.doSign(input, privateKey);
@ -583,7 +583,7 @@ public class DeterministicKey extends ECKey {
} }
/** /**
* Verifies equality of all fields but NOT the parent pointer (thus the same key derived in two separate heirarchy * Verifies equality of all fields but NOT the parent pointer (thus the same key derived in two separate hierarchy
* objects will equal each other. * objects will equal each other.
*/ */
@Override @Override

View file

@ -894,7 +894,7 @@ public class DeterministicKeyChain implements EncryptableKeyChain {
if (!isWatchingAccountKey) { if (!isWatchingAccountKey) {
// If the non-encrypted case, the non-leaf keys (account, internal, external) have already // If the non-encrypted case, the non-leaf keys (account, internal, external) have already
// been rederived and inserted at this point. In the encrypted case though, // been rederived and inserted at this point. In the encrypted case though,
// we can't rederive and we must reinsert, potentially building the heirarchy object // we can't rederive and we must reinsert, potentially building the hierarchy object
// if need be. // if need be.
if (path.size() == 0) { if (path.size() == 0) {
// Master key. // Master key.

View file

@ -136,7 +136,7 @@ public class ChildKeyDerivationTest {
@Test @Test
public void encryptedDerivation() throws Exception { public void encryptedDerivation() throws Exception {
// Check that encrypting a parent key in the heirarchy and then deriving from it yields a DeterministicKey // Check that encrypting a parent key in the hierarchy and then deriving from it yields a DeterministicKey
// with no private key component, and that the private key bytes are derived on demand. // with no private key component, and that the private key bytes are derived on demand.
KeyCrypter scrypter = new KeyCrypterScrypt(); KeyCrypter scrypter = new KeyCrypterScrypt();
KeyParameter aesKey = scrypter.deriveKey("we never went to the moon"); KeyParameter aesKey = scrypter.deriveKey("we never went to the moon");