fix: demote Mnemonic#validate to private, validation is now automatic in the constructor
@@ -193,34 +193,7 @@ public final class Mnemonic {
return toPrivateKey("");
}
- /**
- * Validate that this is a valid BIP-39 mnemonic as generated by BIP-39's rules.
- * <p>
- * Technically, invalid mnemonics can still be used to generate valid private keys,
- * but if they became invalid due to user error then it will be difficult for the user
- * to tell the difference unless they compare the generated keys.
- * <p>
- * During validation, the following conditions are checked in order:
- * <ol>
- * <li>{@link #words}{@code .length} is exactly 24.</li>
- * <li>All strings in {@code #words} exist in the BIP-39 standard English word list (no normalization is done).</li>
- * <li>The calculated checksum for the mnemonic equals the checksum encoded in the mnemonic.</li>
- * </ol>
- * <p>
- * If one of these checks do not pass, a {@link BadMnemonicException} is thrown containing the mnemonic
- * and the reason why it failed validation.
- *
- * @see BadMnemonicException
- * @see BadMnemonicReason
- * @see <a href="https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki">
- * Bitcoin Improvement Project proposal 39 (BIP-39)
- * </a>
- * @see <a href="https://github.com/bitcoin/bips/blob/master/bip-0039/english.txt">
- * BIP-39 English word list
- * </a>.
- * @throws BadMnemonicException if the mnemonic does not pass validation.
- */
- public void validate() throws BadMnemonicException {
+ private void validate() throws BadMnemonicException {
if (words.size() != 24) {
throw new BadMnemonicException(this, BadMnemonicReason.BadLength);
}
