master 8025525c2746 cached
122 files
650.3 KB
167.5k tokens
953 symbols
1 requests
Download .txt
Showing preview only (714K chars total). Download the full file or copy to clipboard to get everything.
Repository: QuincySx/BlockchainWallet-Crypto
Branch: master
Commit: 8025525c2746
Files: 122
Total size: 650.3 KB

Directory structure:
gitextract_ei6psuhp/

├── .gitignore
├── LICENSE
├── README.md
├── build.gradle
├── gradle/
│   └── wrapper/
│       ├── gradle-wrapper.jar
│       └── gradle-wrapper.properties
├── gradle.properties
├── gradlew
├── gradlew.bat
├── library/
│   ├── .gitignore
│   ├── build.gradle
│   ├── proguard-rules.pro
│   └── src/
│       ├── androidTest/
│       │   └── java/
│       │       └── com/
│       │           └── quincysx/
│       │               └── crypto/
│       │                   └── ExampleInstrumentedTest.java
│       ├── main/
│       │   ├── AndroidManifest.xml
│       │   ├── java/
│       │   │   └── com/
│       │   │       └── quincysx/
│       │   │           └── crypto/
│       │   │               ├── CoinTypes.java
│       │   │               ├── ECKeyPair.java
│       │   │               ├── ECPublicKey.java
│       │   │               ├── Key.java
│       │   │               ├── SecureCharSequence.java
│       │   │               ├── Transaction.java
│       │   │               ├── TrulySecureRandom.java
│       │   │               ├── bip32/
│       │   │               │   ├── ExtendedKey.java
│       │   │               │   ├── Index.java
│       │   │               │   └── ValidationException.java
│       │   │               ├── bip38/
│       │   │               │   ├── Bip38.java
│       │   │               │   └── Rijndael.java
│       │   │               ├── bip39/
│       │   │               │   ├── ByteUtils.java
│       │   │               │   ├── CharSequenceComparators.java
│       │   │               │   ├── CharSequenceSplitter.java
│       │   │               │   ├── MnemonicGenerator.java
│       │   │               │   ├── MnemonicValidator.java
│       │   │               │   ├── NFKDNormalizer.java
│       │   │               │   ├── Normalization.java
│       │   │               │   ├── PBKDF2WithHmacSHA512.java
│       │   │               │   ├── RandomSeed.java
│       │   │               │   ├── SeedCalculator.java
│       │   │               │   ├── SeedCalculatorByWordListLookUp.java
│       │   │               │   ├── SpongyCastlePBKDF2WithHmacSHA512.java
│       │   │               │   ├── WordCount.java
│       │   │               │   ├── WordList.java
│       │   │               │   ├── WordListMapNormalization.java
│       │   │               │   ├── exception/
│       │   │               │   │   └── MnemonicException.java
│       │   │               │   ├── validation/
│       │   │               │   │   ├── InvalidChecksumException.java
│       │   │               │   │   ├── InvalidWordCountException.java
│       │   │               │   │   ├── UnexpectedWhiteSpaceException.java
│       │   │               │   │   └── WordNotFoundException.java
│       │   │               │   └── wordlists/
│       │   │               │       ├── English.java
│       │   │               │       ├── French.java
│       │   │               │       ├── Japanese.java
│       │   │               │       └── Spanish.java
│       │   │               ├── bip44/
│       │   │               │   ├── Account.java
│       │   │               │   ├── AddressIndex.java
│       │   │               │   ├── BIP44.java
│       │   │               │   ├── Change.java
│       │   │               │   ├── CoinPairDerive.java
│       │   │               │   ├── CoinType.java
│       │   │               │   ├── M.java
│       │   │               │   └── Purpose.java
│       │   │               ├── bitcoin/
│       │   │               │   ├── BTCTransaction.java
│       │   │               │   ├── BitCoinECKeyPair.java
│       │   │               │   ├── BitcoinException.java
│       │   │               │   ├── BitcoinInputStream.java
│       │   │               │   └── BitcoinOutputStream.java
│       │   │               ├── eip55/
│       │   │               │   └── EthCheckAddress.java
│       │   │               ├── eos/
│       │   │               │   └── EOSECKeyPair.java
│       │   │               ├── ethereum/
│       │   │               │   ├── Bloom.java
│       │   │               │   ├── ByteArrayWrapper.java
│       │   │               │   ├── CallTransaction.java
│       │   │               │   ├── ECDSASignature.java
│       │   │               │   ├── EthECKeyPair.java
│       │   │               │   ├── EthTransaction.java
│       │   │               │   ├── config/
│       │   │               │   │   └── Constants.java
│       │   │               │   ├── keystore/
│       │   │               │   │   ├── CipherException.java
│       │   │               │   │   ├── KeyStore.java
│       │   │               │   │   └── KeyStoreFile.java
│       │   │               │   ├── rlp/
│       │   │               │   │   ├── CompactEncoder.java
│       │   │               │   │   ├── DecodeResult.java
│       │   │               │   │   ├── RLP.java
│       │   │               │   │   ├── RLPElement.java
│       │   │               │   │   ├── RLPItem.java
│       │   │               │   │   ├── RLPList.java
│       │   │               │   │   └── Value.java
│       │   │               │   ├── solidity/
│       │   │               │   │   └── SolidityType.java
│       │   │               │   ├── utils/
│       │   │               │   │   ├── ByteUtil.java
│       │   │               │   │   └── FastByteComparisons.java
│       │   │               │   └── vm/
│       │   │               │       ├── DataWord.java
│       │   │               │       └── LogInfo.java
│       │   │               ├── exception/
│       │   │               │   ├── CoinNotFindException.java
│       │   │               │   └── NonSupportException.java
│       │   │               └── utils/
│       │   │                   ├── BTCUtils.java
│       │   │                   ├── Base58.java
│       │   │                   ├── Base58Check.java
│       │   │                   ├── Base64.java
│       │   │                   ├── HexUtils.java
│       │   │                   ├── HmacSha512.java
│       │   │                   ├── KECCAK256.java
│       │   │                   ├── RIPEMD160.java
│       │   │                   └── SHA256.java
│       │   └── res/
│       │       └── values/
│       │           └── strings.xml
│       └── test/
│           └── java/
│               └── com/
│                   └── quincysx/
│                       └── crypto/
│                           ├── Bip32UnitTest.java
│                           ├── Bip39UnitTest.java
│                           ├── Bip44UnitTest.java
│                           ├── Eip55UnitTest.java
│                           ├── ExampleUnitTest.java
│                           └── HashUnitTest.java
├── sample/
│   ├── .gitignore
│   ├── build.gradle
│   ├── proguard-rules.pro
│   └── src/
│       ├── androidTest/
│       │   └── java/
│       │       └── com/
│       │           └── quincysx/
│       │               └── crypto/
│       │                   └── ExampleInstrumentedTest.java
│       ├── main/
│       │   ├── AndroidManifest.xml
│       │   ├── java/
│       │   │   └── com/
│       │   │       └── quincysx/
│       │   │           └── crypto/
│       │   │               └── smpale/
│       │   │                   ├── Main1Activity.java
│       │   │                   └── MainActivity.java
│       │   └── res/
│       │       ├── drawable/
│       │       │   └── ic_launcher_background.xml
│       │       ├── drawable-v24/
│       │       │   └── ic_launcher_foreground.xml
│       │       ├── layout/
│       │       │   └── activity_main.xml
│       │       ├── mipmap-anydpi-v26/
│       │       │   ├── ic_launcher.xml
│       │       │   └── ic_launcher_round.xml
│       │       └── values/
│       │           ├── colors.xml
│       │           ├── strings.xml
│       │           └── styles.xml
│       └── test/
│           └── java/
│               └── com/
│                   └── quincysx/
│                       └── crypto/
│                           └── ExampleUnitTest.java
└── settings.gradle

================================================
FILE CONTENTS
================================================

================================================
FILE: .gitignore
================================================
*.iml
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.idea/
.DS_Store
/build
/captures
.externalNativeBuild


================================================
FILE: LICENSE
================================================
                    GNU GENERAL PUBLIC LICENSE
                       Version 3, 29 June 2007

 Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
 Everyone is permitted to copy and distribute verbatim copies
 of this license document, but changing it is not allowed.

                            Preamble

  The GNU General Public License is a free, copyleft license for
software and other kinds of works.

  The licenses for most software and other practical works are designed
to take away your freedom to share and change the works.  By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.  We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors.  You can apply it to
your programs, too.

  When we speak of free software, we are referring to freedom, not
price.  Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.

  To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights.  Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.

  For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received.  You must make sure that they, too, receive
or can get the source code.  And you must show them these terms so they
know their rights.

  Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.

  For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software.  For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.

  Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so.  This is fundamentally incompatible with the aim of
protecting users' freedom to change the software.  The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable.  Therefore, we
have designed this version of the GPL to prohibit the practice for those
products.  If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.

  Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary.  To prevent this, the GPL assures that
patents cannot be used to render the program non-free.

  The precise terms and conditions for copying, distribution and
modification follow.

                       TERMS AND CONDITIONS

  0. Definitions.

  "This License" refers to version 3 of the GNU General Public License.

  "Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.

  "The Program" refers to any copyrightable work licensed under this
License.  Each licensee is addressed as "you".  "Licensees" and
"recipients" may be individuals or organizations.

  To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy.  The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.

  A "covered work" means either the unmodified Program or a work based
on the Program.

  To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy.  Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.

  To "convey" a work means any kind of propagation that enables other
parties to make or receive copies.  Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.

  An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License.  If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.

  1. Source Code.

  The "source code" for a work means the preferred form of the work
for making modifications to it.  "Object code" means any non-source
form of a work.

  A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.

  The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form.  A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.

  The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities.  However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work.  For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.

  The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.

  The Corresponding Source for a work in source code form is that
same work.

  2. Basic Permissions.

  All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met.  This License explicitly affirms your unlimited
permission to run the unmodified Program.  The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work.  This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.

  You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force.  You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright.  Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.

  Conveying under any other circumstances is permitted solely under
the conditions stated below.  Sublicensing is not allowed; section 10
makes it unnecessary.

  3. Protecting Users' Legal Rights From Anti-Circumvention Law.

  No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.

  When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.

  4. Conveying Verbatim Copies.

  You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.

  You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.

  5. Conveying Modified Source Versions.

  You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:

    a) The work must carry prominent notices stating that you modified
    it, and giving a relevant date.

    b) The work must carry prominent notices stating that it is
    released under this License and any conditions added under section
    7.  This requirement modifies the requirement in section 4 to
    "keep intact all notices".

    c) You must license the entire work, as a whole, under this
    License to anyone who comes into possession of a copy.  This
    License will therefore apply, along with any applicable section 7
    additional terms, to the whole of the work, and all its parts,
    regardless of how they are packaged.  This License gives no
    permission to license the work in any other way, but it does not
    invalidate such permission if you have separately received it.

    d) If the work has interactive user interfaces, each must display
    Appropriate Legal Notices; however, if the Program has interactive
    interfaces that do not display Appropriate Legal Notices, your
    work need not make them do so.

  A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit.  Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.

  6. Conveying Non-Source Forms.

  You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:

    a) Convey the object code in, or embodied in, a physical product
    (including a physical distribution medium), accompanied by the
    Corresponding Source fixed on a durable physical medium
    customarily used for software interchange.

    b) Convey the object code in, or embodied in, a physical product
    (including a physical distribution medium), accompanied by a
    written offer, valid for at least three years and valid for as
    long as you offer spare parts or customer support for that product
    model, to give anyone who possesses the object code either (1) a
    copy of the Corresponding Source for all the software in the
    product that is covered by this License, on a durable physical
    medium customarily used for software interchange, for a price no
    more than your reasonable cost of physically performing this
    conveying of source, or (2) access to copy the
    Corresponding Source from a network server at no charge.

    c) Convey individual copies of the object code with a copy of the
    written offer to provide the Corresponding Source.  This
    alternative is allowed only occasionally and noncommercially, and
    only if you received the object code with such an offer, in accord
    with subsection 6b.

    d) Convey the object code by offering access from a designated
    place (gratis or for a charge), and offer equivalent access to the
    Corresponding Source in the same way through the same place at no
    further charge.  You need not require recipients to copy the
    Corresponding Source along with the object code.  If the place to
    copy the object code is a network server, the Corresponding Source
    may be on a different server (operated by you or a third party)
    that supports equivalent copying facilities, provided you maintain
    clear directions next to the object code saying where to find the
    Corresponding Source.  Regardless of what server hosts the
    Corresponding Source, you remain obligated to ensure that it is
    available for as long as needed to satisfy these requirements.

    e) Convey the object code using peer-to-peer transmission, provided
    you inform other peers where the object code and Corresponding
    Source of the work are being offered to the general public at no
    charge under subsection 6d.

  A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.

  A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling.  In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage.  For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product.  A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.

  "Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source.  The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.

  If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information.  But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).

  The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed.  Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.

  Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.

  7. Additional Terms.

  "Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law.  If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.

  When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it.  (Additional permissions may be written to require their own
removal in certain cases when you modify the work.)  You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.

  Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:

    a) Disclaiming warranty or limiting liability differently from the
    terms of sections 15 and 16 of this License; or

    b) Requiring preservation of specified reasonable legal notices or
    author attributions in that material or in the Appropriate Legal
    Notices displayed by works containing it; or

    c) Prohibiting misrepresentation of the origin of that material, or
    requiring that modified versions of such material be marked in
    reasonable ways as different from the original version; or

    d) Limiting the use for publicity purposes of names of licensors or
    authors of the material; or

    e) Declining to grant rights under trademark law for use of some
    trade names, trademarks, or service marks; or

    f) Requiring indemnification of licensors and authors of that
    material by anyone who conveys the material (or modified versions of
    it) with contractual assumptions of liability to the recipient, for
    any liability that these contractual assumptions directly impose on
    those licensors and authors.

  All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10.  If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term.  If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.

  If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.

  Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.

  8. Termination.

  You may not propagate or modify a covered work except as expressly
provided under this License.  Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).

  However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.

  Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.

  Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License.  If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.

  9. Acceptance Not Required for Having Copies.

  You are not required to accept this License in order to receive or
run a copy of the Program.  Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance.  However,
nothing other than this License grants you permission to propagate or
modify any covered work.  These actions infringe copyright if you do
not accept this License.  Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.

  10. Automatic Licensing of Downstream Recipients.

  Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License.  You are not responsible
for enforcing compliance by third parties with this License.

  An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations.  If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.

  You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License.  For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.

  11. Patents.

  A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based.  The
work thus licensed is called the contributor's "contributor version".

  A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version.  For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.

  Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.

  In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement).  To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.

  If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients.  "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.

  If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.

  A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License.  You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.

  Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.

  12. No Surrender of Others' Freedom.

  If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License.  If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all.  For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.

  13. Use with the GNU Affero General Public License.

  Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work.  The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.

  14. Revised Versions of this License.

  The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time.  Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.

  Each version is given a distinguishing version number.  If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation.  If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.

  If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.

  Later license versions may give you additional or different
permissions.  However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.

  15. Disclaimer of Warranty.

  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

  16. Limitation of Liability.

  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.

  17. Interpretation of Sections 15 and 16.

  If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.

                     END OF TERMS AND CONDITIONS

            How to Apply These Terms to Your New Programs

  If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.

  To do so, attach the following notices to the program.  It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.

    <one line to give the program's name and a brief idea of what it does.>
    Copyright (C) <year>  <name of author>

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.

Also add information on how to contact you by electronic and paper mail.

  If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:

    <program>  Copyright (C) <year>  <name of author>
    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
    This is free software, and you are welcome to redistribute it
    under certain conditions; type `show c' for details.

The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License.  Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".

  You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.

  The GNU General Public License does not permit incorporating your program
into proprietary programs.  If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library.  If this is what you want to do, use the GNU Lesser General
Public License instead of this License.  But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.


================================================
FILE: README.md
================================================
# BlockchainWallet-Crypto
[![](https://jitpack.io/v/QuincySx/BlockchainWallet-Crypto.svg)](https://jitpack.io/#QuincySx/BlockchainWallet-Crypto)

# 长时间不维护可移步 https://github.com/QuincySx/ChainWallet

#### 简介
##### 这个库到底能干什么
1. 生成比特币公私钥地址
2. 生成以太坊公私钥地址
3. 根据 UTXO 信息打包比特币交易
4. 根据 nonce 信息打包以太坊交易
5. 对比特币交易进行签名
6. 对以太坊交易进行签名
7. 支持 BIP39 助记词
8. 支持 BIP32 子私钥
9. 支持 BIP44 多币种管理
10. 支持 BIP38 加密私钥导入导出
11. 支持以太坊 keystore 导入导出
12. 生成以太坊调用智能合约的参数
13. 生成 EOS 公私钥

#### EOS 从助记词生成私钥
现在 EOS 从助记词生成私钥有两种方式
1. 12 个助记词之间用空格隔开拼接成字符串,然后 Hash 得到私钥
2. 采用 Bip44 标准的生成方案,EOS 的币种序号详见最下方⎡相关资料⎦中的⎡Bip44 注册币种列表⎦

经过国内大部分钱包商议统一使用第二种方案解决 EOS 从助记词生成私钥的问题

#### 欢迎给位提设计上的 lssues 和 pr

#### 引入项目

```
allprojects {
  repositories {
    ...
		maven { url 'https://jitpack.io' }
  }
}
  
dependencies {
  implementation 'com.github.QuincySx:BlockchainWallet-Crypto:last-version'
}
```

#### 使用说明
[简单使用说明](https://github.com/QuincySx/BlockchainWallet-Crypto/wiki)

## 相关资料
[Bip44 注册币种列表](https://github.com/satoshilabs/slips/blob/master/slip-0044.md)

## LICENSE
[开源协议](LICENSE)


================================================
FILE: build.gradle
================================================
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.2'
        

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}


================================================
FILE: gradle/wrapper/gradle-wrapper.properties
================================================
#Tue Mar 27 20:02:31 CST 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip


================================================
FILE: gradle.properties
================================================
# Project-wide Gradle settings.

# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.

# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html

# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx1536m

# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true


================================================
FILE: gradlew
================================================
#!/usr/bin/env bash

##############################################################################
##
##  Gradle start up script for UN*X
##
##############################################################################

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""

APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"

warn ( ) {
    echo "$*"
}

die ( ) {
    echo
    echo "$*"
    echo
    exit 1
}

# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
case "`uname`" in
  CYGWIN* )
    cygwin=true
    ;;
  Darwin* )
    darwin=true
    ;;
  MINGW* )
    msys=true
    ;;
esac

# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
    ls=`ls -ld "$PRG"`
    link=`expr "$ls" : '.*-> \(.*\)$'`
    if expr "$link" : '/.*' > /dev/null; then
        PRG="$link"
    else
        PRG=`dirname "$PRG"`"/$link"
    fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null

CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar

# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
        # IBM's JDK on AIX uses strange locations for the executables
        JAVACMD="$JAVA_HOME/jre/sh/java"
    else
        JAVACMD="$JAVA_HOME/bin/java"
    fi
    if [ ! -x "$JAVACMD" ] ; then
        die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
    fi
else
    JAVACMD="java"
    which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi

# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
    MAX_FD_LIMIT=`ulimit -H -n`
    if [ $? -eq 0 ] ; then
        if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
            MAX_FD="$MAX_FD_LIMIT"
        fi
        ulimit -n $MAX_FD
        if [ $? -ne 0 ] ; then
            warn "Could not set maximum file descriptor limit: $MAX_FD"
        fi
    else
        warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
    fi
fi

# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
    GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi

# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
    APP_HOME=`cygpath --path --mixed "$APP_HOME"`
    CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
    JAVACMD=`cygpath --unix "$JAVACMD"`

    # We build the pattern for arguments to be converted via cygpath
    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
    SEP=""
    for dir in $ROOTDIRSRAW ; do
        ROOTDIRS="$ROOTDIRS$SEP$dir"
        SEP="|"
    done
    OURCYGPATTERN="(^($ROOTDIRS))"
    # Add a user-defined pattern to the cygpath arguments
    if [ "$GRADLE_CYGPATTERN" != "" ] ; then
        OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
    fi
    # Now convert the arguments - kludge to limit ourselves to /bin/sh
    i=0
    for arg in "$@" ; do
        CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
        CHECK2=`echo "$arg"|egrep -c "^-"`                                 ### Determine if an option

        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition
            eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
        else
            eval `echo args$i`="\"$arg\""
        fi
        i=$((i+1))
    done
    case $i in
        (0) set -- ;;
        (1) set -- "$args0" ;;
        (2) set -- "$args0" "$args1" ;;
        (3) set -- "$args0" "$args1" "$args2" ;;
        (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
        (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
        (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
        (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
        (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
        (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
    esac
fi

# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
    JVM_OPTS=("$@")
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"

exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"


================================================
FILE: gradlew.bat
================================================
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem  Gradle startup script for Windows
@rem
@rem ##########################################################################

@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto init

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:init
@rem Get command-line arguments, handling Windowz variants

if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args

:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2

:win9xME_args_slurp
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*
goto execute

:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$

:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if  not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1

:mainEnd
if "%OS%"=="Windows_NT" endlocal

:omega


================================================
FILE: library/.gitignore
================================================
/build


================================================
FILE: library/build.gradle
================================================
apply plugin: 'com.android.library'

android {
    compileSdkVersion 27



    defaultConfig {
        minSdkVersion 15
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

}

dependencies {
    api fileTree(dir: 'libs', include: ['*.jar'])
    api "com.cedarsoftware:java-util:1.8.0"
    api "com.fasterxml.jackson.core:jackson-databind:2.8.5"
    api 'com.madgag.spongycastle:core:1.58.0.0'
    api 'com.madgag.spongycastle:prov:1.58.0.0'
    api 'com.lambdaworks:scrypt:1.4.0'

}


================================================
FILE: library/proguard-rules.pro
================================================
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
#   http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
#   public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile


================================================
FILE: library/src/androidTest/java/com/quincysx/crypto/ExampleInstrumentedTest.java
================================================
package com.quincysx.crypto;

import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;

import org.junit.Test;
import org.junit.runner.RunWith;

import static org.junit.Assert.*;

/**
 * Instrumented test, which will execute on an Android device.
 *
 * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
 */
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
    @Test
    public void useAppContext() throws Exception {
        // Context of the app under test.
        Context appContext = InstrumentationRegistry.getTargetContext();

        assertEquals("com.quincysx.crypto.test", appContext.getPackageName());
    }
}


================================================
FILE: library/src/main/AndroidManifest.xml
================================================
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.quincysx.crypto" />


================================================
FILE: library/src/main/java/com/quincysx/crypto/CoinTypes.java
================================================
package com.quincysx.crypto;

import com.quincysx.crypto.exception.CoinNotFindException;

/**
 * Created by q7728 on 2018/3/18.
 */

public enum CoinTypes {
    Bitcoin(0, "BTC"),
    BitcoinTest(1, "BTC"),
    Litecoin(2, "LTC"),
    Dogecoin(3, "DOGE"),
    Ethereum(60, "ETH"),
    EOS(194, "EOS");

    private int coinType;
    private String coinName;

    CoinTypes(int i, String name) {
        coinType = i;
        coinName = name;
    }

    public int coinType() {
        return coinType;
    }

    public String coinName() {
        return coinName;
    }

    public static CoinTypes parseCoinType(int type) throws CoinNotFindException {
        for (CoinTypes e : CoinTypes.values()) {
            if (e.coinType == type) {
                return e;
            }
        }
        throw new CoinNotFindException("The currency is not supported for the time being");
    }
}


================================================
FILE: library/src/main/java/com/quincysx/crypto/ECKeyPair.java
================================================
/*
 * Copyright 2013 bits of proof zrt.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.quincysx.crypto;

import com.quincysx.crypto.bip32.ValidationException;
import com.quincysx.crypto.utils.RIPEMD160;

import org.spongycastle.asn1.ASN1InputStream;
import org.spongycastle.asn1.DERInteger;
import org.spongycastle.asn1.DLSequence;
import org.spongycastle.asn1.sec.SECNamedCurves;
import org.spongycastle.asn1.x9.X9ECParameters;
import org.spongycastle.crypto.AsymmetricCipherKeyPair;
import org.spongycastle.crypto.generators.ECKeyPairGenerator;
import org.spongycastle.crypto.params.ECDomainParameters;
import org.spongycastle.crypto.params.ECKeyGenerationParameters;
import org.spongycastle.crypto.params.ECPrivateKeyParameters;
import org.spongycastle.crypto.params.ECPublicKeyParameters;
import org.spongycastle.crypto.signers.ECDSASigner;
import org.spongycastle.math.ec.ECPoint;
import org.spongycastle.util.Arrays;

import java.io.IOException;
import java.math.BigInteger;
import java.security.SecureRandom;


public class ECKeyPair implements Key {
    protected static final SecureRandom secureRandom = new SecureRandom();
    protected static final X9ECParameters CURVE = SECNamedCurves.getByName("secp256k1");
    protected static final ECDomainParameters domain = new ECDomainParameters(CURVE.getCurve(),
            CURVE.getG(), CURVE.getN(), CURVE.getH());
    protected static final BigInteger LARGEST_PRIVATE_KEY = new BigInteger
            ("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141", 16);

    protected BigInteger priv;
    protected byte[] pub;
    protected byte[] pubComp;
    protected boolean compressed;

    protected ECKeyPair() {
    }

    public ECKeyPair(byte[] p, boolean compressed) throws ValidationException {
        this(new BigInteger(1, p), compressed);
        if (!(p.length == 32 || p.length == 43 )) {
            throw new ValidationException("Invalid private key");
        }
    }

    public ECKeyPair(BigInteger priv, boolean compressed) {
        this.priv = priv;
        this.compressed = compressed;

        ECPoint multiply = CURVE.getG().multiply(priv);
        this.pub = multiply.getEncoded(false);
        this.pubComp = multiply.getEncoded(true);
    }

    protected ECKeyPair(Key keyPair) {
        this.priv = new BigInteger(1, keyPair.getRawPrivateKey());
        this.compressed = keyPair.isCompressed();
        this.pub = Arrays.clone(keyPair.getRawPublicKey(false));
        this.pubComp = Arrays.clone(keyPair.getRawPublicKey());
    }

    @Override
    public boolean isCompressed() {
        return compressed;
    }

    @Override
    public ECKeyPair clone() throws CloneNotSupportedException {
        ECKeyPair c = (ECKeyPair) super.clone();
        c.priv = new BigInteger(c.priv.toByteArray());
        c.pub = Arrays.clone(pub);
        c.pubComp = Arrays.clone(pubComp);
        c.compressed = compressed;
        return c;
    }

    public static ECKeyPair createNew(boolean compressed) {
        ECKeyPairGenerator generator = new ECKeyPairGenerator();
        ECKeyGenerationParameters keygenParams = new ECKeyGenerationParameters(domain,
                secureRandom);
        generator.init(keygenParams);
        AsymmetricCipherKeyPair keypair = generator.generateKeyPair();
        ECPrivateKeyParameters privParams = (ECPrivateKeyParameters) keypair.getPrivate();
        ECPublicKeyParameters pubParams = (ECPublicKeyParameters) keypair.getPublic();
        ECKeyPair k = new ECKeyPair();
        k.priv = privParams.getD();
        k.compressed = compressed;
        ECPoint multiply = CURVE.getG().multiply(k.priv);
        k.pub = multiply.getEncoded(false);
        k.pubComp = multiply.getEncoded(true);
        return k;
    }

    public void setPublic(byte[] pub) throws ValidationException {
        throw new ValidationException("Can not set public key if private is present");
    }

    @Override
    public byte[] getRawPrivateKey() {
        byte[] p = priv.toByteArray();

        if (p.length != 32) {
            byte[] tmp = new byte[32];
            System.arraycopy(p, Math.max(0, p.length - 32), tmp, Math.max(0, 32 - p.length), Math
                    .min(32, p.length));
            p = tmp;
        }
        return p;
    }

    @Override
    public byte[] getRawPublicKey(boolean isCompressed) {
        if (isCompressed) {
            return Arrays.clone(pubComp);
        } else {
            return Arrays.clone(pub);
        }
    }

    @Override
    public byte[] getRawPublicKey() {
        return getRawPublicKey(true);
    }

    @Override
    public byte[] getRawAddress() {
        return RIPEMD160.hash160(pubComp);
    }

    @Override
    public String getPrivateKey() {
        throw new RuntimeException("No formatted private Key");
    }

    @Override
    public String getPublicKey() {
        throw new RuntimeException("No formatted public Key");
    }

    @Override
    public String getAddress() {
        throw new RuntimeException("No formatted address");
    }

    @Override
    public <T> T sign(byte[] messageHash) throws ValidationException {
        throw new ValidationException("Please convert to ECKeyPair subclass signature");
    }

    public static boolean verify(byte[] hash, byte[] signature, byte[] pub) {
        ASN1InputStream asn1 = new ASN1InputStream(signature);
        try {
            ECDSASigner signer = new ECDSASigner();
            signer.init(false, new ECPublicKeyParameters(CURVE.getCurve().decodePoint(pub),
                    domain));

            DLSequence seq = (DLSequence) asn1.readObject();
            BigInteger r = ((DERInteger) seq.getObjectAt(0)).getPositiveValue();
            BigInteger s = ((DERInteger) seq.getObjectAt(1)).getPositiveValue();
            return signer.verifySignature(hash, r, s);
        } catch (Exception e) {
            // threat format errors as invalid signatures
            return false;
        } finally {
            try {
                asn1.close();
            } catch (IOException e) {
            }
        }
    }
}


================================================
FILE: library/src/main/java/com/quincysx/crypto/ECPublicKey.java
================================================
/*
 * Copyright 2013 bits of proof zrt.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.quincysx.crypto;


import com.quincysx.crypto.utils.RIPEMD160;

import org.spongycastle.util.Arrays;

public class ECPublicKey implements Key {
    private byte[] pub;
    private boolean compressed;

    public ECPublicKey(byte[] pub, boolean compressed) {
        this.pub = pub;
        this.compressed = compressed;
    }

    @Override
    public boolean isCompressed() {
        return compressed;
    }

    public void setCompressed(boolean compressed) {
        this.compressed = compressed;
    }

    @Override
    public byte[] getRawPrivateKey() {
        throw new RuntimeException("Please use private key to sign signature");
    }

    @Override
    public byte[] getRawPublicKey(boolean isCompressed) {
        if (!isCompressed) {
            throw new RuntimeException("No compressed public key");
        }
        return Arrays.clone(pub);
    }

    @Override
    public byte[] getRawPublicKey() {
        return Arrays.clone(pub);
    }

    @Override
    public byte[] getRawAddress() {
        return RIPEMD160.hash160(pub);
    }

    @Override
    public String getPrivateKey() {
        throw new RuntimeException("Please use private key to sign signature");
    }

    @Override
    public String getPublicKey() {
        throw new RuntimeException("No formatted public Key");
    }

    @Override
    public String getAddress() {
        throw new RuntimeException("No formatted address");
    }

    @Override
    public ECPublicKey clone() throws CloneNotSupportedException {
        ECPublicKey c = (ECPublicKey) super.clone();
        c.pub = Arrays.clone(pub);
        return c;
    }

    @Override
    public <T> T sign(byte[] messageHash) {
        throw new RuntimeException("Please use private key to sign signature");
    }

}


================================================
FILE: library/src/main/java/com/quincysx/crypto/Key.java
================================================
/*
 * Copyright 2013 bits of proof zrt.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.quincysx.crypto;


import com.quincysx.crypto.bip32.ValidationException;

public interface Key extends Cloneable {
    /**
     * 获取原生私钥
     *
     * @return
     */
    public byte[] getRawPrivateKey();

    /**
     * 获取公钥
     *
     * @param isCompressed 是否压缩
     * @return 原生公钥
     */
    public byte[] getRawPublicKey(boolean isCompressed);

    /**
     * 获取原生压缩公钥
     *
     * @return
     */
    public byte[] getRawPublicKey();

    /**
     * 获取地址
     *
     * @return
     */
    public byte[] getRawAddress();

    /**
     * 获取格式化的私钥
     *
     * @return
     */
    public String getPrivateKey();

    /**
     * 获取格式化的公钥
     *
     * @return
     */
    public String getPublicKey();

    /**
     * 获取格式化的地址
     *
     * @return
     */
    public String getAddress();

    /**
     * 获取判断公钥是否是压缩格式
     *
     * @return
     */
    public boolean isCompressed();

    public Key clone() throws CloneNotSupportedException;

    public <T extends Object> T sign(byte[] messageHash) throws ValidationException;

}

================================================
FILE: library/src/main/java/com/quincysx/crypto/SecureCharSequence.java
================================================
package com.quincysx.crypto;

import java.security.SecureRandom;
import java.util.Arrays;

/**
 * @author QuincySx
 * @date 2018/3/9 下午2:57
 */
public class SecureCharSequence implements CharSequence {
    private char[] chars;

    public SecureCharSequence(CharSequence charSequence) {
        this(charSequence, 0, charSequence.length());
    }

    public SecureCharSequence(char[] chars) {
        wipe();
        this.chars = chars;
    }

    private SecureCharSequence(CharSequence charSequence, int start, int end) {
        // pulled from http://stackoverflow.com/a/15844273
        wipe();
        int length = end - start;
        chars = new char[length];
        for (int i = start;
             i < end;
             i++) {
            chars[i - start] = charSequence.charAt(i);
        }
    }

    public void wipe() {
        if (chars != null) {
            Arrays.fill(chars, ' ');
            SecureRandom r = new SecureRandom();
            byte[] bytes = new byte[chars.length];
            r.nextBytes(bytes);
            for (int i = 0;
                 i < chars.length;
                 i++) {
                chars[i] = (char) bytes[i];
            }
            Arrays.fill(chars, ' ');
        }
    }

    protected void finalize() {
        wipe();
    }

    @Override
    public int length() {
        if (chars != null) {
            return chars.length;
        }
        return 0;
    }

    @Override
    public char charAt(int index) {
        if (chars != null) {
            return chars[index];
        }
        return 0;
    }

    @Override
    public String toString() {
        return String.valueOf(this.chars);
    }

    @Override
    public boolean equals(Object o) {
        if (o instanceof SecureCharSequence) {
            return Arrays.equals(chars, ((SecureCharSequence) o).chars);
        }
        return false;
    }

    @Override
    public CharSequence subSequence(int start, int end) {
        SecureCharSequence s = new SecureCharSequence(this, start, end);
        return s;
    }
}


================================================
FILE: library/src/main/java/com/quincysx/crypto/Transaction.java
================================================
package com.quincysx.crypto;

import com.quincysx.crypto.bip32.ValidationException;

/**
 * @author QuincySx
 * @date 2018/3/8 下午1:56
 */
public interface Transaction {
    byte[] sign(ECKeyPair key) throws ValidationException;

    public byte[] getSignBytes();

    /**
     * Eth 使用的方法
     *
     * @return
     */
    public byte[] getData();


}


================================================
FILE: library/src/main/java/com/quincysx/crypto/TrulySecureRandom.java
================================================
/*
 The MIT License (MIT)

 Copyright (c) 2013 Valentin Konovalov

 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal
 in the Software without restriction, including without limitation the rights
 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the Software is
 furnished to do so, subject to the following conditions:

 The above copyright notice and this permission notice shall be included in
 all copies or substantial portions of the Software.

 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 THE SOFTWARE.*/
package com.quincysx.crypto;

import android.os.Build;
import android.os.SystemClock;
import android.util.Log;

import com.quincysx.crypto.utils.HexUtils;

import org.spongycastle.crypto.digests.SHA256Digest;
import org.spongycastle.crypto.prng.DigestRandomGenerator;
import org.spongycastle.crypto.prng.ThreadedSeedGenerator;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;

public class TrulySecureRandom extends java.security.SecureRandom {
    private static final String TAG = "SecureRandom";
    private final DigestRandomGenerator generator;
    private boolean initialized;


    public TrulySecureRandom() {
        generator = new DigestRandomGenerator(new SHA256Digest());
    }

    public void addSeedMaterial(long seed) {
        generator.addSeedMaterial(seed);
    }

    private void addSeedMaterial(byte[] seed) {
        generator.addSeedMaterial(seed);
    }

    @Override
    public int nextInt() {
        byte[] buf = new byte[4];
        nextBytes(buf);
        return ((buf[0] & 0xff) << 24) | ((buf[1] & 0xff) << 16) | ((buf[2] & 0xff) << 8) | (buf[3] & 0xff);
    }

    @Override
    public int nextInt(int n) {
        return Math.abs(nextInt()) % n;
    }

    @Override
    public synchronized void nextBytes(byte[] bytes) {
        if (!initialized) {
            long start = System.currentTimeMillis();
            ThreadedSeedGenerator threadedSeedGenerator = new ThreadedSeedGenerator();
            do {
                addSeedMaterial(threadedSeedGenerator.generateSeed(64, true));
                try {
                    Thread.sleep(1);
                } catch (InterruptedException ignored) {
                }
                addSeedMaterial(threadedSeedGenerator.generateSeed(32, false));
            } while (Math.abs(System.currentTimeMillis() - start) < 1000);
            addSeedMaterial(System.nanoTime());
            addSeedMaterial(System.currentTimeMillis());
            addSeedMaterial(SystemClock.elapsedRealtime());
            addSeedMaterial(SystemClock.currentThreadTimeMillis());
            addSeedMaterial(new java.security.SecureRandom().generateSeed(128));
            addSeedMaterial(("" + Build.DEVICE + Build.MODEL + Build.TIME + Build.VERSION.SDK_INT).getBytes());

            ExecutorService executor = Executors.newSingleThreadExecutor();
            try {
                Future future = executor.submit(new Runnable() {
                    @Override
                    public void run() {
                        byte[] devRandomSeed = getDevRandomSeed();
                        if (devRandomSeed != null) {
                            addSeedMaterial(devRandomSeed);
                        }
                    }
                });

                future.get(3, TimeUnit.SECONDS);
            } catch (InterruptedException e) {
                Log.v(TAG, "/dev/random read interrupted");
            } catch (ExecutionException e) {
                Log.e(TAG, "/dev/random read error");
            } catch (TimeoutException e) {
                Log.w(TAG, "/dev/random read timeout");
            } finally {
                executor.shutdownNow();
            }
            initialized = true;
        }
        generator.nextBytes(bytes);
    }


    @Override
    public String getAlgorithm() {
        return "BouncyCastle";
    }

    private byte[] getDevRandomSeed() {
        byte[] buf = null;
        File file = new File("/dev/random");
        FileInputStream inputStream = null;
        try {
            inputStream = new FileInputStream(file);
            buf = new byte[16];
            for (int i = 0; i < buf.length; i++) {
                int ch = inputStream.read();
                if (ch == -1) {
                    return null;
                }
                buf[i] = (byte) ch;
            }
        } catch (Exception ignored) {
        } finally {
            if (inputStream != null) {
                try {
                    inputStream.close();
                } catch (IOException ignored) {

                }
            }
        }
        return buf;
    }

    @Override
    public void setSeed(byte[] seed) {
        Log.w("SecureRandom", "setting seed " + HexUtils.toHex(seed) + " was ignored");
    }

    @Override
    public void setSeed(long seed) {
        Log.w("SecureRandom", "setting seed " + seed + " was ignored");
    }

    @Override
    public byte[] generateSeed(int numBytes) {
        throw new RuntimeException("not supported");
    }

    @Override
    public boolean nextBoolean() {
        throw new RuntimeException("not supported");
    }

    @Override
    public double nextDouble() {
        throw new RuntimeException("not supported");
    }

    @Override
    public float nextFloat() {
        throw new RuntimeException("not supported");
    }

    @Override
    public synchronized double nextGaussian() {
        throw new RuntimeException("not supported");
    }

    @Override
    public long nextLong() {
        throw new RuntimeException("not supported");
    }

}


================================================
FILE: library/src/main/java/com/quincysx/crypto/bip32/ExtendedKey.java
================================================
/*
 * Copyright 2013 bits of proof zrt.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.quincysx.crypto.bip32;

import com.quincysx.crypto.ECKeyPair;
import com.quincysx.crypto.ECPublicKey;
import com.quincysx.crypto.Key;
import com.quincysx.crypto.utils.Base58Check;

import org.spongycastle.asn1.sec.SECNamedCurves;
import org.spongycastle.asn1.x9.X9ECParameters;
import org.spongycastle.crypto.generators.SCrypt;
import org.spongycastle.math.ec.ECPoint;
import org.spongycastle.util.Arrays;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.math.BigInteger;
import java.security.InvalidAlgorithmParameterException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.security.NoSuchProviderException;
import java.security.SecureRandom;

import javax.crypto.BadPaddingException;
import javax.crypto.Cipher;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.Mac;
import javax.crypto.NoSuchPaddingException;
import javax.crypto.SecretKey;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;

/**
 * Key Generator following BIP32 https://en.bitcoin.it/wiki/BIP_0032
 */
public class ExtendedKey {
    private static final SecureRandom rnd = new SecureRandom();
    private static final X9ECParameters curve = SECNamedCurves.getByName("secp256k1");

    private final Key master;
    private final byte[] chainCode;
    private final int depth;
    private final int parent;
    private final int sequence;

    private static final byte[] BITCOIN_SEED = "Bitcoin seed".getBytes();

    public static ExtendedKey createFromPassphrase(String passphrase, byte[] encrypted) throws
            ValidationException {
        try {
            byte[] key = SCrypt.generate(passphrase.getBytes("UTF-8"), BITCOIN_SEED, 16384, 8, 8,
                    32);
            SecretKeySpec keyspec = new SecretKeySpec(key, "AES");
            if (encrypted.length == 32) {
                // asssume encrypted is seed
                Cipher cipher = Cipher.getInstance("AES/ECB/NoPadding", "BC");
                cipher.init(Cipher.DECRYPT_MODE, keyspec);
                return create(cipher.doFinal(encrypted));
            } else {
                // assume encrypted serialization of a key
                Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding", "BC");
                byte[] iv = Arrays.copyOfRange(encrypted, 0, 16);
                byte[] data = Arrays.copyOfRange(encrypted, 16, encrypted.length);
                cipher.init(Cipher.DECRYPT_MODE, keyspec, new IvParameterSpec(iv));
                return ExtendedKey.parse(new String(cipher.doFinal(data)));
            }
        } catch (UnsupportedEncodingException e) {
            throw new ValidationException(e);
        } catch (IllegalBlockSizeException e) {
            throw new ValidationException(e);
        } catch (BadPaddingException e) {
            throw new ValidationException(e);
        } catch (InvalidKeyException e) {
            throw new ValidationException(e);
        } catch (NoSuchAlgorithmException e) {
            throw new ValidationException(e);
        } catch (NoSuchProviderException e) {
            throw new ValidationException(e);
        } catch (NoSuchPaddingException e) {
            throw new ValidationException(e);
        } catch (InvalidAlgorithmParameterException e) {
            throw new ValidationException(e);
        }
    }

    public byte[] encrypt(String passphrase, boolean production) throws ValidationException {
        try {
            byte[] key = SCrypt.generate(passphrase.getBytes("UTF-8"), BITCOIN_SEED, 16384, 8, 8,
                    32);
            SecretKeySpec keyspec = new SecretKeySpec(key, "AES");
            Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding", "BC");
            cipher.init(Cipher.ENCRYPT_MODE, keyspec);
            byte[] iv = cipher.getIV();
            byte[] c = cipher.doFinal(serialize(production).getBytes());
            byte[] result = new byte[iv.length + c.length];
            System.arraycopy(iv, 0, result, 0, iv.length);
            System.arraycopy(c, 0, result, iv.length, c.length);
            return result;
        } catch (UnsupportedEncodingException | NoSuchAlgorithmException |
                NoSuchProviderException | NoSuchPaddingException | InvalidKeyException
                | IllegalBlockSizeException | BadPaddingException e) {
            throw new ValidationException(e);
        }
    }

    public static ExtendedKey create(byte[] seed) throws ValidationException {
        try {
            Mac mac = Mac.getInstance("HmacSHA512", "BC");
            SecretKey seedkey = new SecretKeySpec(BITCOIN_SEED, "HmacSHA512");
            mac.init(seedkey);
            byte[] lr = mac.doFinal(seed);
            byte[] l = Arrays.copyOfRange(lr, 0, 32);
            byte[] r = Arrays.copyOfRange(lr, 32, 64);
            BigInteger m = new BigInteger(1, l);
            if (m.compareTo(curve.getN()) >= 0) {
                throw new ValidationException("This is rather unlikely, but it did just happen");
            }
            ECKeyPair keyPair = new ECKeyPair(l, true);
            return new ExtendedKey(keyPair, r, 0, 0, 0);
        } catch (NoSuchAlgorithmException e) {
            throw new ValidationException(e);
        } catch (NoSuchProviderException e) {
            throw new ValidationException(e);
        } catch (InvalidKeyException e) {
            throw new ValidationException(e);
        }
    }

    public static ExtendedKey createNew() {
        Key key = ECKeyPair.createNew(true);
        byte[] chainCode = new byte[32];
        rnd.nextBytes(chainCode);
        return new ExtendedKey(key, chainCode, 0, 0, 0);
    }

    /**
     * @param bytes
     * @return
     * @throws ValidationException
     * @deprecated
     */
    public static ExtendedKey parsePrivateKey(byte[] bytes) throws ValidationException {
        Key key = new ECKeyPair(bytes, true);
        byte[] chainCode = new byte[32];
        rnd.nextBytes(chainCode);
        return new ExtendedKey(key, chainCode, 0, 0, 0);
    }

    public ExtendedKey(Key key, byte[] chainCode, int depth, int parent, int sequence) {
        this.master = key;
        this.chainCode = chainCode;
        this.parent = parent;
        this.depth = depth;
        this.sequence = sequence;
    }

    public Key getMaster() {
        return master;
    }

    public byte[] getChainCode() {
        return Arrays.clone(chainCode);
    }

    public int getDepth() {
        return depth;
    }

    public int getParent() {
        return parent;
    }

    public int getSequence() {
        return sequence;
    }

    public int getFingerPrint() {
        int fingerprint = 0;
        byte[] address = master.getRawAddress();
        for (int i = 0; i < 4; ++i) {
            fingerprint <<= 8;
            fingerprint |= address[i] & 0xff;
        }
        return fingerprint;
    }

    public Key getKey(int sequence) throws ValidationException {
        return generateKey(sequence).getMaster();
    }

    public ExtendedKey getChild(int sequence) throws ValidationException {
        ExtendedKey sub = generateKey(sequence);
        return new ExtendedKey(sub.getMaster(), sub.getChainCode(), sub.getDepth() + 1,
                getFingerPrint(), sequence);
    }

    public ExtendedKey getReadOnly() {
        return new ExtendedKey(new ECPublicKey(master.getRawPublicKey(), true), chainCode, depth,
                parent, sequence);
    }

    public boolean isReadOnly() {
        return master.getRawPrivateKey() == null;
    }

    private ExtendedKey generateKey(int sequence) throws ValidationException {
        try {
            if ((sequence & 0x80000000) != 0 && master.getRawPrivateKey() == null) {
                throw new ValidationException("need private key for private generation");
            }
            Mac mac = Mac.getInstance("HmacSHA512", "BC");
            SecretKey key = new SecretKeySpec(chainCode, "HmacSHA512");
            mac.init(key);

            byte[] extended;
            byte[] pub = master.getRawPublicKey();
            if ((sequence & 0x80000000) == 0) {
                extended = new byte[pub.length + 4];
                System.arraycopy(pub, 0, extended, 0, pub.length);
                extended[pub.length] = (byte) ((sequence >>> 24) & 0xff);
                extended[pub.length + 1] = (byte) ((sequence >>> 16) & 0xff);
                extended[pub.length + 2] = (byte) ((sequence >>> 8) & 0xff);
                extended[pub.length + 3] = (byte) (sequence & 0xff);
            } else {
                byte[] priv = master.getRawPrivateKey();
                extended = new byte[priv.length + 5];
                System.arraycopy(priv, 0, extended, 1, priv.length);
                extended[priv.length + 1] = (byte) ((sequence >>> 24) & 0xff);
                extended[priv.length + 2] = (byte) ((sequence >>> 16) & 0xff);
                extended[priv.length + 3] = (byte) ((sequence >>> 8) & 0xff);
                extended[priv.length + 4] = (byte) (sequence & 0xff);
            }
            byte[] lr = mac.doFinal(extended);
            byte[] l = Arrays.copyOfRange(lr, 0, 32);
            byte[] r = Arrays.copyOfRange(lr, 32, 64);

            BigInteger m = new BigInteger(1, l);
            if (m.compareTo(curve.getN()) >= 0) {
                throw new ValidationException("This is rather unlikely, but it did just happen");
            }
            if (master.getRawPrivateKey() != null) {
                BigInteger k = m.add(new BigInteger(1, master.getRawPrivateKey())).mod(curve.getN
                        ());
                if (k.equals(BigInteger.ZERO)) {
                    throw new ValidationException("This is rather unlikely, but it did just " +
                            "happen");
                }
                return new ExtendedKey(new ECKeyPair(k, true), r, depth, parent, sequence);
            } else {
                ECPoint q = curve.getG().multiply(m).add(curve.getCurve().decodePoint(pub));
                if (q.isInfinity()) {
                    throw new ValidationException("This is rather unlikely, but it did just " +
                            "happen");
                }
                pub = new ECPoint.Fp(curve.getCurve(), q.getX(), q.getY(), true).getEncoded();
                return new ExtendedKey(new ECPublicKey(pub, true), r, depth, parent, sequence);
            }
        } catch (NoSuchAlgorithmException e) {
            throw new ValidationException(e);
        } catch (NoSuchProviderException e) {
            throw new ValidationException(e);
        } catch (InvalidKeyException e) {
            throw new ValidationException(e);
        }
    }

    private static final byte[] xprv = new byte[]{0x04, (byte) 0x88, (byte) 0xAD, (byte) 0xE4};
    private static final byte[] xpub = new byte[]{0x04, (byte) 0x88, (byte) 0xB2, (byte) 0x1E};
    private static final byte[] tprv = new byte[]{0x04, (byte) 0x35, (byte) 0x83, (byte) 0x94};
    private static final byte[] tpub = new byte[]{0x04, (byte) 0x35, (byte) 0x87, (byte) 0xCF};

    public String serialize(boolean production) {
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        try {
            if (master.getRawPrivateKey() != null) {
                if (production) {
                    out.write(xprv);
                } else {
                    out.write(tprv);
                }
            } else {
                if (production) {
                    out.write(xpub);
                } else {
                    out.write(tpub);
                }
            }
            out.write(depth & 0xff);
            out.write((parent >>> 24) & 0xff);
            out.write((parent >>> 16) & 0xff);
            out.write((parent >>> 8) & 0xff);
            out.write(parent & 0xff);
            out.write((sequence >>> 24) & 0xff);
            out.write((sequence >>> 16) & 0xff);
            out.write((sequence >>> 8) & 0xff);
            out.write(sequence & 0xff);
            out.write(chainCode);
            if (master.getRawPrivateKey() != null) {
                out.write(0x00);
                out.write(master.getRawPrivateKey());
            } else {
                out.write(master.getRawPublicKey());
            }
        } catch (IOException e) {
        }
        return Base58Check.bytesToBase58(out.toByteArray());
    }

    public static ExtendedKey parse(String serialized) throws ValidationException {
        byte[] data = Base58Check.base58ToBytes(serialized);
        if (data.length != 78) {
            throw new ValidationException("invalid extended key");
        }
        byte[] type = Arrays.copyOf(data, 4);
        boolean hasPrivate;
        if (Arrays.areEqual(type, xprv) || Arrays.areEqual(type, tprv)) {
            hasPrivate = true;
        } else if (Arrays.areEqual(type, xpub) || Arrays.areEqual(type, tpub)) {
            hasPrivate = false;
        } else {
            throw new ValidationException("invalid magic number for an extended key");
        }

        int depth = data[4] & 0xff;

        int parent = data[5] & 0xff;
        parent <<= 8;
        parent |= data[6] & 0xff;
        parent <<= 8;
        parent |= data[7] & 0xff;
        parent <<= 8;
        parent |= data[8] & 0xff;

        int sequence = data[9] & 0xff;
        sequence <<= 8;
        sequence |= data[10] & 0xff;
        sequence <<= 8;
        sequence |= data[11] & 0xff;
        sequence <<= 8;
        sequence |= data[12] & 0xff;

        byte[] chainCode = Arrays.copyOfRange(data, 13, 13 + 32);
        byte[] pubOrPriv = Arrays.copyOfRange(data, 13 + 32, data.length);
        Key key;
        if (hasPrivate) {
            key = new ECKeyPair(new BigInteger(1, pubOrPriv), true);
        } else {
            key = new ECPublicKey(pubOrPriv, true);
        }
        return new ExtendedKey(key, chainCode, depth, parent, sequence);
    }
}


================================================
FILE: library/src/main/java/com/quincysx/crypto/bip32/Index.java
================================================
package com.quincysx.crypto.bip32;

/**
 * @author QuincySx
 * @date 2018/3/5 下午4:29
 */
public final class Index {
    Index() {
    }

    public static int hard(final int index) {
        return index | 0x80000000;
    }

    public static boolean isHardened(final int i) {
        return (i & 0x80000000) != 0;
    }
}


================================================
FILE: library/src/main/java/com/quincysx/crypto/bip32/ValidationException.java
================================================
/*
 * Copyright 2013 bits of proof zrt.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.quincysx.crypto.bip32;

public class ValidationException extends Exception
{
	private static final long serialVersionUID = 1L;

	public ValidationException(Throwable cause)
	{
		super (cause);
	}

	public ValidationException(String message, Throwable cause)
	{
		super (message, cause);
	}

	public ValidationException(String message)
	{
		super (message);
	}
}


================================================
FILE: library/src/main/java/com/quincysx/crypto/bip38/Bip38.java
================================================
package com.quincysx.crypto.bip38;


import com.quincysx.crypto.bip32.ValidationException;
import com.quincysx.crypto.bitcoin.BitCoinECKeyPair;
import com.quincysx.crypto.utils.Base58;
import com.quincysx.crypto.utils.HexUtils;
import com.quincysx.crypto.utils.SHA256;

import org.spongycastle.crypto.generators.SCrypt;

import java.math.BigInteger;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.nio.charset.Charset;
import java.util.Arrays;

/**
 * @author QuincySx
 * @date 2018/3/8 下午2:41
 */
public class Bip38 {
    //官方推荐参数 性能差的手机耗时特别长
    private static final int SCRYPT_N = 16384;
    private static final int SCRYPT_R = 8;
    private static final int SCRYPT_P = 8;

    //性能差的手机也秒出,安全性差
//    private static final int SCRYPT_N = 1024;
//    private static final int SCRYPT_R = 1;
//    private static final int SCRYPT_P = 1;

    private static final int SCRYPT_LENGTH = 64;

    private static final BigInteger n = new BigInteger(1, HexUtils.fromHex("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"));

    /**
     * Encrypt a SIPA formatted private key with a passphrase using BIP38.
     * <p/>
     * This is a helper function that does everything in one go. You can call the
     * individual functions if you wish to separate it into more phases.
     *
     * @throws InterruptedException
     */
    public static String encryptNoEcMultiply(CharSequence passphrase, String base58EncodedPrivateKey) throws ValidationException, InterruptedException {
        byte[] tmp = Base58.decode(base58EncodedPrivateKey);

        int version = tmp[0] & 0xFF;

        byte[] bytes = new byte[tmp.length - 4 - 1];
        System.arraycopy(tmp, 1, bytes, 0, bytes.length);
        boolean compressed = true;
        if (bytes.length == 33 && bytes[32] == 1) {
            compressed = true;
            bytes = java.util.Arrays.copyOf(bytes, 32);  // Chop off the additional marker byte.
        } else if (bytes.length == 32) {
            compressed = false;
        }

        boolean testNet = false;
        if (version == BitCoinECKeyPair.TEST_NET_PRIVATE_KEY_PREFIX) {
            testNet = true;
        } else if (version == BitCoinECKeyPair.MAIN_NET_PRIVATE_KEY_PREFIX) {
            testNet = false;
        }

        Arrays.fill(tmp, (byte) 0);

        BitCoinECKeyPair bitCoinECKeyPair = new BitCoinECKeyPair(bytes, testNet, compressed);

        byte[] salt = Bip38.calculateScryptSalt(bitCoinECKeyPair.getAddress());
        byte[] stretchedKeyMaterial = bip38Stretch1(passphrase, salt, SCRYPT_LENGTH);

        return encryptNoEcMultiply(stretchedKeyMaterial, bitCoinECKeyPair, salt);
    }

    /**
     * Perform BIP38 compatible password stretching on a password to derive the
     * BIP38 key material
     *
     * @throws InterruptedException
     */
    public static byte[] bip38Stretch1(CharSequence passphrase, byte[] salt, int outputSize)
            throws InterruptedException {
        byte[] passwordBytes = null;
        byte[] derived;
        try {
            passwordBytes = convertToByteArray(passphrase);
            derived = SCrypt.generate(passwordBytes, salt, SCRYPT_N, SCRYPT_R, SCRYPT_P, outputSize
            );
            return derived;
        } finally {
            // Zero the password bytes.
            if (passwordBytes != null) {
                java.util.Arrays.fill(passwordBytes, (byte) 0);
            }
        }
    }

    private static byte[] convertToByteArray(CharSequence charSequence) {
        if (charSequence == null) {
            throw new RuntimeException("charSequence not NULL");
        }
        ByteBuffer bb = Charset.forName("UTF-8").encode(CharBuffer.wrap(charSequence));
        byte[] result = new byte[bb.remaining()];
        bb.get(result);
        bb.clear();
        byte[] clearTest = new byte[bb.remaining()];
        java.util.Arrays.fill(clearTest, (byte) 0);
        bb.put(clearTest);
        return result;
    }

    public static String encryptNoEcMultiply(byte[] stretcedKeyMaterial, BitCoinECKeyPair key, byte[] salt) {
        int checksumLength = 4;
        byte[] encoded = new byte[39 + checksumLength];
        int index = 0;
        encoded[index++] = (byte) 0x01;
        encoded[index++] = (byte) 0x42;

        byte non_EC_multiplied = (byte) 0xC0;
        byte compressedPublicKey = key.isCompressed() ? (byte) 0x20 : (byte) 0;
        encoded[index++] = (byte) (non_EC_multiplied | compressedPublicKey);

        // Salt
        System.arraycopy(salt, 0, encoded, index, salt.length);
        index += salt.length;

        // Derive Keys
        byte[] derivedHalf1 = new byte[32];
        System.arraycopy(stretcedKeyMaterial, 0, derivedHalf1, 0, 32);
        byte[] derivedHalf2 = new byte[32];
        System.arraycopy(stretcedKeyMaterial, 32, derivedHalf2, 0, 32);

        // Initialize AES key
        Rijndael aes = new Rijndael();
        aes.makeKey(derivedHalf2, 256);

        // Get private key bytes
        byte[] complete = key.getRawPrivateKey();

        // Insert first encrypted key part
        byte[] toEncryptPart1 = new byte[16];
        for (int i = 0; i < 16; i++) {
            toEncryptPart1[i] = (byte) ((((int) complete[i]) & 0xFF) ^ (((int) derivedHalf1[i]) & 0xFF));
        }
        byte[] encryptedHalf1 = new byte[16];
        aes.encrypt(toEncryptPart1, encryptedHalf1);
        System.arraycopy(encryptedHalf1, 0, encoded, index, encryptedHalf1.length);
        index += encryptedHalf1.length;

        // Insert second encrypted key part
        byte[] toEncryptPart2 = new byte[16];
        for (int i = 0; i < 16; i++) {
            toEncryptPart2[i] = (byte) ((((int) complete[16 + i]) & 0xFF) ^ (((int) derivedHalf1[16 + i]) & 0xFF));
        }
        byte[] encryptedHalf2 = new byte[16];
        aes.encrypt(toEncryptPart2, encryptedHalf2);
        System.arraycopy(encryptedHalf2, 0, encoded, index, encryptedHalf2.length);
        index += encryptedHalf2.length;

        // Checksum
        byte[] checkSum = SHA256.doubleSha256(encoded, 0, 39);

        byte[] start = new byte[4];
        System.arraycopy(checkSum, 0, start, 0, 4);

        System.arraycopy(start, 0, encoded, 39, checksumLength);

        // Base58 encode
        return Base58.encode(encoded);
    }

    public static boolean isBip38PrivateKey(String bip38PrivateKey) {
        return parseBip38PrivateKey(bip38PrivateKey) != null;
    }

    public static class Bip38PrivateKey {
        public boolean ecMultiply;
        public boolean compressed;
        public boolean lotSequence;
        public byte[] salt;
        public byte[] data;

        public Bip38PrivateKey(boolean ecMultiply, boolean compressed, boolean lotSequence, byte[] salt, byte[] data) {
            this.ecMultiply = ecMultiply;
            this.compressed = compressed;
            this.lotSequence = lotSequence;
            this.salt = salt;
            this.data = data;
        }
    }

    public static Bip38PrivateKey parseBip38PrivateKey(String bip38PrivateKey) {
        // Decode Base 58
        byte[] decoded = Base58.decode(bip38PrivateKey);
        if (decoded == null) {
            return null;
        }

        //Validate length
        if (!(decoded.length == 39 || decoded.length == 43)) {
            return null;
        }

        int index = 0;

        // Validate BIP 38 prefix
        if (decoded[index++] != (byte) 0x01) {
            return null;
        }
        boolean ecMultiply;
        if (decoded[index] == (byte) 0x42) {
            ecMultiply = false;
        } else if (decoded[index] == (byte) 0x43) {
            ecMultiply = true;
        } else {
            return null;
        }
        index++;

        // Validate flags and determine whether we have a compressed key
        int flags = ((int) decoded[index++]) & 0x00ff;

        boolean lotSequence;

        if (ecMultiply) {
            if ((flags | 0x0024) != 0x24) {
                // Only bit 3 and 6 can be set for EC-multiply keys
                return null;
            }
            lotSequence = (flags & 0x0004) == 0 ? false : true;
        } else {
            if ((flags | 0x00E0) != 0xE0) {
                // Only bit 6 7 and 8 can be set for non-EC-multiply keys
                return null;
            }
            if ((flags & 0x00c0) != 0x00c0) {
                // Upper two bits must be set for non-EC-multiplied key
                return null;
            }
            lotSequence = false;
        }

        boolean compressed = (flags & 0x0020) == 0 ? false : true;

        // Fetch salt
        byte[] salt = new byte[4];
        salt[0] = decoded[index++];
        salt[1] = decoded[index++];
        salt[2] = decoded[index++];
        salt[3] = decoded[index++];

        // Fetch data
        byte[] data = new byte[32];
        System.arraycopy(decoded, index, data, 0, data.length);
        index += data.length;

        return new Bip38PrivateKey(ecMultiply, compressed, lotSequence, salt, data);
    }

    /**
     * 可能为 Null ,Null 代表密码不正确
     */
    public static BitCoinECKeyPair decrypt(String bip38PrivateKeyString, CharSequence passphrase) throws InterruptedException, ValidationException {
        Bip38PrivateKey bip38Key = parseBip38PrivateKey(bip38PrivateKeyString);
        if (bip38Key == null) {
            return null;
        }
        if (bip38Key.ecMultiply) {
            return decryptEcMultiply(bip38Key, passphrase);
        } else {
            byte[] stretcedKeyMaterial = bip38Stretch1(passphrase, bip38Key.salt, SCRYPT_LENGTH);
            return decryptNoEcMultiply(bip38Key, stretcedKeyMaterial);
        }
    }

    public static BitCoinECKeyPair decryptEcMultiply(Bip38PrivateKey bip38Key, CharSequence passphrase
    ) throws InterruptedException, ValidationException {
        // Get 8 byte Owner Salt
        byte[] ownerEntropy = new byte[8];
        System.arraycopy(bip38Key.data, 0, ownerEntropy, 0, 8);

        byte[] ownerSalt = ownerEntropy;
        if (bip38Key.lotSequence) {
            ownerSalt = new byte[4];
            System.arraycopy(ownerEntropy, 0, ownerSalt, 0, 4);
        }

        // Stretch to get Pass Factor
        byte[] passFactor = bip38Stretch1(passphrase, ownerSalt, 32);

        if (bip38Key.lotSequence) {
            byte[] tmp = new byte[40];
            System.arraycopy(passFactor, 0, tmp, 0, 32);
            System.arraycopy(ownerEntropy, 0, tmp, 32, 8);
            //we convert to byte[] here since this can be a sha256 or Scrypt result.
            // might make sense to introduce a 32 byte scrypt type
            passFactor = SHA256.doubleSha256(tmp);
        }
        // Determine Pass Point

        BitCoinECKeyPair bitCoinECKeyPair = new BitCoinECKeyPair(passFactor, false, bip38Key.compressed);
        byte[] passPoint = bitCoinECKeyPair.getRawPublicKey();

        // Get 8 byte encrypted part 1, only first half of encrypted part 1
        // (the rest is encrypted within encryptedpart2)
        byte[] encryptedPart1 = new byte[16];
        System.arraycopy(bip38Key.data, 8, encryptedPart1, 0, 8);
        // Get 16 byte encrypted part 2
        byte[] encryptedPart2 = new byte[16];
        System.arraycopy(bip38Key.data, 16, encryptedPart2, 0, 16);

        // Second stretch to derive decryption key
        byte[] saltPlusOwnerSalt = new byte[12];
        System.arraycopy(bip38Key.salt, 0, saltPlusOwnerSalt, 0, 4);
        System.arraycopy(ownerEntropy, 0, saltPlusOwnerSalt, 4, 8);
//        byte[] derived = SCrypt.generate(passPoint, saltPlusOwnerSalt, 1024, 1, 1, 64);
        byte[] derived = SCrypt.generate(passPoint, saltPlusOwnerSalt, SCRYPT_N, SCRYPT_R, SCRYPT_P, SCRYPT_LENGTH);
        byte[] derivedQuater1 = new byte[16];
        System.arraycopy(derived, 0, derivedQuater1, 0, 16);
        byte[] derivedQuater2 = new byte[16];
        System.arraycopy(derived, 16, derivedQuater2, 0, 16);
        byte[] derivedHalf2 = new byte[32];
        System.arraycopy(derived, 32, derivedHalf2, 0, 32);

        Rijndael aes = new Rijndael();
        aes.makeKey(derivedHalf2, 256);

        byte[] unencryptedPart2 = new byte[16];
        aes.decrypt(encryptedPart2, unencryptedPart2);
        xorBytes(derivedQuater2, unencryptedPart2);

        // Get second half of encrypted half 1
        System.arraycopy(unencryptedPart2, 0, encryptedPart1, 8, 8);

        // Decrypt part 1
        byte[] unencryptedPart1 = new byte[16];
        aes.decrypt(encryptedPart1, unencryptedPart1);
        xorBytes(derivedQuater1, unencryptedPart1);

        // Recover seedB
        byte[] seedB = new byte[24];
        System.arraycopy(unencryptedPart1, 0, seedB, 0, 16);
        System.arraycopy(unencryptedPart2, 8, seedB, 16, 8);

        // Generate factorB
        byte[] factorB = SHA256.doubleSha256(seedB);

        BigInteger privateKey = new BigInteger(1, passFactor).multiply(new BigInteger(1, factorB).mod(n));
        byte[] keyBytes = new byte[32];
        byte[] bytes = privateKey.toByteArray();
        if (bytes.length <= keyBytes.length) {
            System.arraycopy(bytes, 0, keyBytes, keyBytes.length - bytes.length, bytes.length);
        } else {
            assert bytes.length == 33 && bytes[0] == 0;
            System.arraycopy(bytes, 1, keyBytes, 0, bytes.length - 1);
        }

        BitCoinECKeyPair ecKeyPair = verify(keyBytes, bip38Key.salt, false, bip38Key.compressed);
        if (ecKeyPair == null) {
            return verify(keyBytes, bip38Key.salt, true, bip38Key.compressed);
        }
        return ecKeyPair;
    }

    public static BitCoinECKeyPair decryptNoEcMultiply(Bip38PrivateKey bip38Key, byte[] stretcedKeyMaterial) throws ValidationException {
        // Derive Keys
        byte[] derivedHalf1 = new byte[32];
        System.arraycopy(stretcedKeyMaterial, 0, derivedHalf1, 0, 32);
        byte[] derivedHalf2 = new byte[32];
        System.arraycopy(stretcedKeyMaterial, 32, derivedHalf2, 0, 32);

        // Initialize AES key
        Rijndael aes = new Rijndael();
        aes.makeKey(derivedHalf2, 256);

        // Fetch first encrypted half
        byte[] encryptedHalf1 = new byte[16];
        System.arraycopy(bip38Key.data, 0, encryptedHalf1, 0, encryptedHalf1.length);

        // Fetch second encrypted half
        byte[] encryptedHalf2 = new byte[16];
        System.arraycopy(bip38Key.data, 16, encryptedHalf2, 0, encryptedHalf2.length);

        byte[] decryptedHalf1 = new byte[16];
        aes.decrypt(encryptedHalf1, decryptedHalf1);

        byte[] decryptedHalf2 = new byte[16];
        aes.decrypt(encryptedHalf2, decryptedHalf2);

        byte[] complete = new byte[32];
        for (int i = 0; i < 16; i++) {
            complete[i] = (byte) ((((int) decryptedHalf1[i]) & 0xFF) ^ (((int) derivedHalf1[i]) & 0xFF));
            complete[i + 16] = (byte) ((((int) decryptedHalf2[i]) & 0xFF) ^ (((int) derivedHalf1[i + 16]) & 0xFF));
        }

        BitCoinECKeyPair bitCoinECKeyPair = verify(complete, bip38Key.salt, false, bip38Key.compressed);
        if (bitCoinECKeyPair == null) {
            return verify(complete, bip38Key.salt, true, bip38Key.compressed);
        }
        return bitCoinECKeyPair;
    }

    private static BitCoinECKeyPair verify(byte[] complete, byte[] salt, boolean testNet, boolean compress) throws ValidationException {
        BitCoinECKeyPair bitCoinECKeyPair = new BitCoinECKeyPair(complete, testNet, compress);

        byte[] newSalt = calculateScryptSalt(bitCoinECKeyPair.getAddress());
        if (!java.util.Arrays.equals(salt, newSalt)) {
            // The passphrase is either invalid or we are on the wrong network
            return null;
        }
        return bitCoinECKeyPair;
    }


    public static byte[] calculateScryptSalt(String address) {
        byte[] hash = SHA256.doubleSha256(address.getBytes());
        byte[] ret = new byte[4];
        System.arraycopy(hash, 0, ret, 0, 4);
        return ret;
    }

    private static void xorBytes(byte[] toApply, byte[] target) {
        if (toApply.length != target.length) {
            throw new RuntimeException();
        }
        for (int i = 0; i < toApply.length; i++) {
            target[i] = (byte) (target[i] ^ toApply[i]);
        }
    }

}


================================================
FILE: library/src/main/java/com/quincysx/crypto/bip38/Rijndael.java
================================================
package com.quincysx.crypto.bip38;

/**
 * @author QuincySx
 * @date 2018/3/9 下午2:09
 */
public final class Rijndael {

    public Rijndael() {
    }

    /**
     * Flag to setup the encryption key schedule.
     */
    public static final int DIR_ENCRYPT = 1;

    /**
     * Flag to setup the decryption key schedule.
     */
    public static final int DIR_DECRYPT = 2;

    /**
     * Flag to setup both key schedules (encryption/decryption).
     */
    public static final int DIR_BOTH = (DIR_ENCRYPT | DIR_DECRYPT);

    /**
     * AES block size in bits
     * (N.B. the Rijndael algorithm itself allows for other sizes).
     */
    public static final int BLOCK_BITS = 128;

    /**
     * AES block size in bytes
     * (N.B. the Rijndael algorithm itself allows for other sizes).
     */
    public static final int BLOCK_SIZE = (BLOCK_BITS >>> 3);

    /**
     * Substitution table (S-box).
     */
    private static final String SS =
            "\u637C\u777B\uF26B\u6FC5\u3001\u672B\uFED7\uAB76" +
                    "\uCA82\uC97D\uFA59\u47F0\uADD4\uA2AF\u9CA4\u72C0" +
                    "\uB7FD\u9326\u363F\uF7CC\u34A5\uE5F1\u71D8\u3115" +
                    "\u04C7\u23C3\u1896\u059A\u0712\u80E2\uEB27\uB275" +
                    "\u0983\u2C1A\u1B6E\u5AA0\u523B\uD6B3\u29E3\u2F84" +
                    "\u53D1\u00ED\u20FC\uB15B\u6ACB\uBE39\u4A4C\u58CF" +
                    "\uD0EF\uAAFB\u434D\u3385\u45F9\u027F\u503C\u9FA8" +
                    "\u51A3\u408F\u929D\u38F5\uBCB6\uDA21\u10FF\uF3D2" +
                    "\uCD0C\u13EC\u5F97\u4417\uC4A7\u7E3D\u645D\u1973" +
                    "\u6081\u4FDC\u222A\u9088\u46EE\uB814\uDE5E\u0BDB" +
                    "\uE032\u3A0A\u4906\u245C\uC2D3\uAC62\u9195\uE479" +
                    "\uE7C8\u376D\u8DD5\u4EA9\u6C56\uF4EA\u657A\uAE08" +
                    "\uBA78\u252E\u1CA6\uB4C6\uE8DD\u741F\u4BBD\u8B8A" +
                    "\u703E\uB566\u4803\uF60E\u6135\u57B9\u86C1\u1D9E" +
                    "\uE1F8\u9811\u69D9\u8E94\u9B1E\u87E9\uCE55\u28DF" +
                    "\u8CA1\u890D\uBFE6\u4268\u4199\u2D0F\uB054\uBB16";

    private static final byte[]
            Se = new byte[256];

    private static final int[]
            Te0 = new int[256],
            Te1 = new int[256],
            Te2 = new int[256],
            Te3 = new int[256];

    private static final byte[]
            Sd = new byte[256];

    private static final int[]
            Td0 = new int[256],
            Td1 = new int[256],
            Td2 = new int[256],
            Td3 = new int[256];

    /**
     * Round constants
     */
    private static final int[]
            rcon = new int[10]; /* for 128-bit blocks, Rijndael never uses more than 10 rcon values */

    /**
     * Number of rounds (depends on key size).
     */
    private int Nr = 0;

    private int Nk = 0;

    private int Nw = 0;

    /**
     * Encryption key schedule
     */
    private int rek[] = null;

    /**
     * Decryption key schedule
     */
    private int rdk[] = null;

    static {
        /*
            Te0[x] = Se[x].[02, 01, 01, 03];
            Te1[x] = Se[x].[03, 02, 01, 01];
            Te2[x] = Se[x].[01, 03, 02, 01];
            Te3[x] = Se[x].[01, 01, 03, 02];
            Td0[x] = Sd[x].[0e, 09, 0d, 0b];
            Td1[x] = Sd[x].[0b, 0e, 09, 0d];
            Td2[x] = Sd[x].[0d, 0b, 0e, 09];
            Td3[x] = Sd[x].[09, 0d, 0b, 0e];
        */
        int ROOT = 0x11B;
        int s1, s2, s3, i1, i2, i4, i8, i9, ib, id, ie, t;
        for (i1 = 0; i1 < 256; i1++) {
            char c = SS.charAt(i1 >>> 1);
            s1 = (byte) ((i1 & 1) == 0 ? c >>> 8 : c) & 0xff;
            s2 = s1 << 1;
            if (s2 >= 0x100) {
                s2 ^= ROOT;
            }
            s3 = s2 ^ s1;
            i2 = i1 << 1;
            if (i2 >= 0x100) {
                i2 ^= ROOT;
            }
            i4 = i2 << 1;
            if (i4 >= 0x100) {
                i4 ^= ROOT;
            }
            i8 = i4 << 1;
            if (i8 >= 0x100) {
                i8 ^= ROOT;
            }
            i9 = i8 ^ i1;
            ib = i9 ^ i2;
            id = i9 ^ i4;
            ie = i8 ^ i4 ^ i2;

            Se[i1] = (byte) s1;
            Te0[i1] = t = (s2 << 24) | (s1 << 16) | (s1 << 8) | s3;
            Te1[i1] = (t >>> 8) | (t << 24);
            Te2[i1] = (t >>> 16) | (t << 16);
            Te3[i1] = (t >>> 24) | (t << 8);

            Sd[s1] = (byte) i1;
            Td0[s1] = t = (ie << 24) | (i9 << 16) | (id << 8) | ib;
            Td1[s1] = (t >>> 8) | (t << 24);
            Td2[s1] = (t >>> 16) | (t << 16);
            Td3[s1] = (t >>> 24) | (t << 8);
        }
        /*
         * round constants
         */
        int r = 1;
        rcon[0] = r << 24;
        for (int i = 1; i < 10; i++) {
            r <<= 1;
            if (r >= 0x100) {
                r ^= ROOT;
            }
            rcon[i] = r << 24;
        }
    }

    /**
     * Expand a cipher key into a full encryption key schedule.
     *
     * @param cipherKey the cipher key (128, 192, or 256 bits).
     */
    private void expandKey(byte[] cipherKey) {
        int temp, r = 0;
        for (int i = 0, k = 0; i < Nk; i++, k += 4) {
            rek[i] =
                    ((cipherKey[k]) << 24) |
                            ((cipherKey[k + 1] & 0xff) << 16) |
                            ((cipherKey[k + 2] & 0xff) << 8) |
                            ((cipherKey[k + 3] & 0xff));
        }
        for (int i = Nk, n = 0; i < Nw; i++, n--) {
            temp = rek[i - 1];
            if (n == 0) {
                n = Nk;
                temp =
                        ((Se[(temp >>> 16) & 0xff]) << 24) |
                                ((Se[(temp >>> 8) & 0xff] & 0xff) << 16) |
                                ((Se[(temp) & 0xff] & 0xff) << 8) |
                                ((Se[(temp >>> 24)] & 0xff));
                temp ^= rcon[r++];
            } else if (Nk == 8 && n == 4) {
                temp =
                        ((Se[(temp >>> 24)]) << 24) |
                                ((Se[(temp >>> 16) & 0xff] & 0xff) << 16) |
                                ((Se[(temp >>> 8) & 0xff] & 0xff) << 8) |
                                ((Se[(temp) & 0xff] & 0xff));
            }
            rek[i] = rek[i - Nk] ^ temp;
        }
        temp = 0;
    }

    /*
      * Faster implementation of the key expansion
      * (only worthwhile in Rijndael is used in a hashing function mode).
      */
    /*
    private void expandKey(byte[] cipherKey) {
        int keyOffset = 0;
           int i = 0;
        int temp;
        rek[0] =
            (cipherKey[ 0]       ) << 24 |
            (cipherKey[ 1] & 0xff) << 16 |
            (cipherKey[ 2] & 0xff) <<  8 |
            (cipherKey[ 3] & 0xff);
        rek[1] =
            (cipherKey[ 4]       ) << 24 |
            (cipherKey[ 5] & 0xff) << 16 |
            (cipherKey[ 6] & 0xff) <<  8 |
            (cipherKey[ 7] & 0xff);
        rek[2] =
            (cipherKey[ 8]       ) << 24 |
            (cipherKey[ 9] & 0xff) << 16 |
            (cipherKey[10] & 0xff) <<  8 |
            (cipherKey[11] & 0xff);
        rek[3] =
            (cipherKey[12]       ) << 24 |
            (cipherKey[13] & 0xff) << 16 |
            (cipherKey[14] & 0xff) <<  8 |
            (cipherKey[15] & 0xff);
        if (Nk == 4) {
            for (;;) {
                temp = rek[keyOffset + 3];
                rek[keyOffset + 4] = rek[keyOffset] ^
                    ((Se[(temp >>> 16) & 0xff]       ) << 24) ^
                    ((Se[(temp >>>  8) & 0xff] & 0xff) << 16) ^
                    ((Se[(temp       ) & 0xff] & 0xff) <<  8) ^
                    ((Se[(temp >>> 24)       ] & 0xff)      ) ^
                    rcon[i];
                rek[keyOffset + 5] = rek[keyOffset + 1] ^ rek[keyOffset + 4];
                rek[keyOffset + 6] = rek[keyOffset + 2] ^ rek[keyOffset + 5];
                rek[keyOffset + 7] = rek[keyOffset + 3] ^ rek[keyOffset + 6];
                if (++i == 10) {
                    return;
                }
                keyOffset += 4;
            }
        }
        rek[keyOffset + 4] =
            (cipherKey[16]       ) << 24 |
            (cipherKey[17] & 0xff) << 16 |
            (cipherKey[18] & 0xff) <<  8 |
            (cipherKey[19] & 0xff);
        rek[keyOffset + 5] =
            (cipherKey[20]       ) << 24 |
            (cipherKey[21] & 0xff) << 16 |
            (cipherKey[22] & 0xff) <<  8 |
            (cipherKey[23] & 0xff);
        if (Nk == 6) {
            for (;;) {
                temp = rek[keyOffset + 5];
                rek[keyOffset +  6] = rek[keyOffset] ^
                    ((Se[(temp >>> 16) & 0xff]       ) << 24) ^
                    ((Se[(temp >>>  8) & 0xff] & 0xff) << 16) ^
                    ((Se[(temp       ) & 0xff] & 0xff) <<  8) ^
                    ((Se[(temp >>> 24)       ] & 0xff)      ) ^
                    rcon[i];
                rek[keyOffset +  7] = rek[keyOffset +  1] ^ rek[keyOffset +  6];
                rek[keyOffset +  8] = rek[keyOffset +  2] ^ rek[keyOffset +  7];
                rek[keyOffset +  9] = rek[keyOffset +  3] ^ rek[keyOffset +  8];
                if (++i == 8) {
                    return;
                }
                rek[keyOffset + 10] = rek[keyOffset +  4] ^ rek[keyOffset +  9];
                rek[keyOffset + 11] = rek[keyOffset +  5] ^ rek[keyOffset + 10];
                keyOffset += 6;
            }
        }
        rek[keyOffset + 6] =
            (cipherKey[24]       ) << 24 |
            (cipherKey[25] & 0xff) << 16 |
            (cipherKey[26] & 0xff) <<  8 |
            (cipherKey[27] & 0xff);
        rek[keyOffset + 7] =
            (cipherKey[28]       ) << 24 |
            (cipherKey[29] & 0xff) << 16 |
            (cipherKey[30] & 0xff) <<  8 |
            (cipherKey[31] & 0xff);
        if (Nk == 8) {
            for (;;) {
                temp = rek[keyOffset +  7];
                rek[keyOffset +  8] = rek[keyOffset] ^
                    ((Se[(temp >>> 16) & 0xff]       ) << 24) ^
                    ((Se[(temp >>>  8) & 0xff] & 0xff) << 16) ^
                    ((Se[(temp       ) & 0xff] & 0xff) <<  8) ^
                    ((Se[(temp >>> 24)       ] & 0xff)      ) ^
                    rcon[i];
                rek[keyOffset +  9] = rek[keyOffset +  1] ^ rek[keyOffset +  8];
                rek[keyOffset + 10] = rek[keyOffset +  2] ^ rek[keyOffset +  9];
                rek[keyOffset + 11] = rek[keyOffset +  3] ^ rek[keyOffset + 10];
                if (++i == 7) {
                    return;
                }
                temp = rek[keyOffset + 11];
                rek[keyOffset + 12] = rek[keyOffset +  4] ^
                    ((Se[(temp >>> 24)       ]       ) << 24) ^
                    ((Se[(temp >>> 16) & 0xff] & 0xff) << 16) ^
                    ((Se[(temp >>>  8) & 0xff] & 0xff) <<  8) ^
                    ((Se[(temp       ) & 0xff] & 0xff));
                rek[keyOffset + 13] = rek[keyOffset +  5] ^ rek[keyOffset + 12];
                rek[keyOffset + 14] = rek[keyOffset +  6] ^ rek[keyOffset + 13];
                rek[keyOffset + 15] = rek[keyOffset +  7] ^ rek[keyOffset + 14];
                keyOffset += 8;
            }
        }
    }
    */

    /**
     * Compute the decryption schedule from the encryption schedule .
     */
    private void invertKey() {
        int d = 0, e = 4 * Nr, w;
        /*
        * apply the inverse MixColumn transform to all round keys
        * but the first and the last:
        */
        rdk[d] = rek[e];
        rdk[d + 1] = rek[e + 1];
        rdk[d + 2] = rek[e + 2];
        rdk[d + 3] = rek[e + 3];
        d += 4;
        e -= 4;
        for (int r = 1; r < Nr; r++) {
            w = rek[e];
            rdk[d] =
                    Td0[Se[(w >>> 24)] & 0xff] ^
                            Td1[Se[(w >>> 16) & 0xff] & 0xff] ^
                            Td2[Se[(w >>> 8) & 0xff] & 0xff] ^
                            Td3[Se[(w) & 0xff] & 0xff];
            w = rek[e + 1];
            rdk[d + 1] =
                    Td0[Se[(w >>> 24)] & 0xff] ^
                            Td1[Se[(w >>> 16) & 0xff] & 0xff] ^
                            Td2[Se[(w >>> 8) & 0xff] & 0xff] ^
                            Td3[Se[(w) & 0xff] & 0xff];
            w = rek[e + 2];
            rdk[d + 2] =
                    Td0[Se[(w >>> 24)] & 0xff] ^
                            Td1[Se[(w >>> 16) & 0xff] & 0xff] ^
                            Td2[Se[(w >>> 8) & 0xff] & 0xff] ^
                            Td3[Se[(w) & 0xff] & 0xff];
            w = rek[e + 3];
            rdk[d + 3] =
                    Td0[Se[(w >>> 24)] & 0xff] ^
                            Td1[Se[(w >>> 16) & 0xff] & 0xff] ^
                            Td2[Se[(w >>> 8) & 0xff] & 0xff] ^
                            Td3[Se[(w) & 0xff] & 0xff];
            d += 4;
            e -= 4;
        }
        rdk[d] = rek[e];
        rdk[d + 1] = rek[e + 1];
        rdk[d + 2] = rek[e + 2];
        rdk[d + 3] = rek[e + 3];
    }

    /**
     * Setup the AES key schedule for encryption, decryption, or both.
     *
     * @param cipherKey the cipher key (128, 192, or 256 bits).
     * @param keyBits   size of the cipher key in bits.
     * @param direction cipher direction (DIR_ENCRYPT, DIR_DECRYPT, or DIR_BOTH).
     */
    public void makeKey(byte[] cipherKey, int keyBits, int direction)
            throws RuntimeException {
        // check key size:
        if (keyBits != 128 && keyBits != 192 && keyBits != 256) {
            throw new RuntimeException("Invalid AES key size (" + keyBits + " bits)");
        }
        Nk = keyBits >>> 5;
        Nr = Nk + 6;
        Nw = 4 * (Nr + 1);
        rek = new int[Nw];
        rdk = new int[Nw];
        if ((direction & DIR_BOTH) != 0) {
            expandKey(cipherKey);
            /*
            for (int r = 0; r <= Nr; r++) {
            	System.out.print("RK" + r + "=");
            	for (int i = 0; i < 4; i++) {
            		int w = rek[4*r + i];
            		System.out.print(" " + Integer.toHexString(w));
            	}
            	System.out.println();
            }
            */
            if ((direction & DIR_DECRYPT) != 0) {
                invertKey();
            }
        }
    }

    /**
     * Setup the AES key schedule (any cipher direction).
     *
     * @param cipherKey the cipher key (128, 192, or 256 bits).
     * @param keyBits   size of the cipher key in bits.
     */
    public void makeKey(byte[] cipherKey, int keyBits)
            throws RuntimeException {
        makeKey(cipherKey, keyBits, DIR_BOTH);
    }

    /**
     * Encrypt exactly one block (BLOCK_SIZE bytes) of plaintext.
     *
     * @param pt plaintext block.
     * @param ct ciphertext block.
     */
    public void encrypt(byte[] pt, byte[] ct) {
        /*
         * map byte array block to cipher state
	     * and add initial round key:
	     */
        int k = 0, v;
        int t0 = ((pt[0]) << 24 |
                (pt[1] & 0xff) << 16 |
                (pt[2] & 0xff) << 8 |
                (pt[3] & 0xff)) ^ rek[0];
        int t1 = ((pt[4]) << 24 |
                (pt[5] & 0xff) << 16 |
                (pt[6] & 0xff) << 8 |
                (pt[7] & 0xff)) ^ rek[1];
        int t2 = ((pt[8]) << 24 |
                (pt[9] & 0xff) << 16 |
                (pt[10] & 0xff) << 8 |
                (pt[11] & 0xff)) ^ rek[2];
        int t3 = ((pt[12]) << 24 |
                (pt[13] & 0xff) << 16 |
                (pt[14] & 0xff) << 8 |
                (pt[15] & 0xff)) ^ rek[3];
        /*
         * Nr - 1 full rounds:
	     */
        for (int r = 1; r < Nr; r++) {
            k += 4;
            int a0 =
                    Te0[(t0 >>> 24)] ^
                            Te1[(t1 >>> 16) & 0xff] ^
                            Te2[(t2 >>> 8) & 0xff] ^
                            Te3[(t3) & 0xff] ^
                            rek[k];
            int a1 =
                    Te0[(t1 >>> 24)] ^
                            Te1[(t2 >>> 16) & 0xff] ^
                            Te2[(t3 >>> 8) & 0xff] ^
                            Te3[(t0) & 0xff] ^
                            rek[k + 1];
            int a2 =
                    Te0[(t2 >>> 24)] ^
                            Te1[(t3 >>> 16) & 0xff] ^
                            Te2[(t0 >>> 8) & 0xff] ^
                            Te3[(t1) & 0xff] ^
                            rek[k + 2];
            int a3 =
                    Te0[(t3 >>> 24)] ^
                            Te1[(t0 >>> 16) & 0xff] ^
                            Te2[(t1 >>> 8) & 0xff] ^
                            Te3[(t2) & 0xff] ^
                            rek[k + 3];
            t0 = a0;
            t1 = a1;
            t2 = a2;
            t3 = a3;
        }
        /*
         * last round lacks MixColumn:
         */
        k += 4;

        v = rek[k];
        ct[0] = (byte) (Se[(t0 >>> 24)] ^ (v >>> 24));
        ct[1] = (byte) (Se[(t1 >>> 16) & 0xff] ^ (v >>> 16));
        ct[2] = (byte) (Se[(t2 >>> 8) & 0xff] ^ (v >>> 8));
        ct[3] = (byte) (Se[(t3) & 0xff] ^ (v));

        v = rek[k + 1];
        ct[4] = (byte) (Se[(t1 >>> 24)] ^ (v >>> 24));
        ct[5] = (byte) (Se[(t2 >>> 16) & 0xff] ^ (v >>> 16));
        ct[6] = (byte) (Se[(t3 >>> 8) & 0xff] ^ (v >>> 8));
        ct[7] = (byte) (Se[(t0) & 0xff] ^ (v));

        v = rek[k + 2];
        ct[8] = (byte) (Se[(t2 >>> 24)] ^ (v >>> 24));
        ct[9] = (byte) (Se[(t3 >>> 16) & 0xff] ^ (v >>> 16));
        ct[10] = (byte) (Se[(t0 >>> 8) & 0xff] ^ (v >>> 8));
        ct[11] = (byte) (Se[(t1) & 0xff] ^ (v));

        v = rek[k + 3];
        ct[12] = (byte) (Se[(t3 >>> 24)] ^ (v >>> 24));
        ct[13] = (byte) (Se[(t0 >>> 16) & 0xff] ^ (v >>> 16));
        ct[14] = (byte) (Se[(t1 >>> 8) & 0xff] ^ (v >>> 8));
        ct[15] = (byte) (Se[(t2) & 0xff] ^ (v));
    }

    /**
     * Decrypt exactly one block (BLOCK_SIZE bytes) of ciphertext.
     *
     * @param ct ciphertext block.
     * @param pt plaintext block.
     */
    public void decrypt(byte[] ct, byte[] pt) {
        /*
         * map byte array block to cipher state
	     * and add initial round key:
	     */
        int k = 0, v;
        int t0 = ((ct[0]) << 24 |
                (ct[1] & 0xff) << 16 |
                (ct[2] & 0xff) << 8 |
                (ct[3] & 0xff)) ^ rdk[0];
        int t1 = ((ct[4]) << 24 |
                (ct[5] & 0xff) << 16 |
                (ct[6] & 0xff) << 8 |
                (ct[7] & 0xff)) ^ rdk[1];
        int t2 = ((ct[8]) << 24 |
                (ct[9] & 0xff) << 16 |
                (ct[10] & 0xff) << 8 |
                (ct[11] & 0xff)) ^ rdk[2];
        int t3 = ((ct[12]) << 24 |
                (ct[13] & 0xff) << 16 |
                (ct[14] & 0xff) << 8 |
                (ct[15] & 0xff)) ^ rdk[3];
        /*
         * Nr - 1 full rounds:
	     */
        for (int r = 1; r < Nr; r++) {
            k += 4;
            int a0 =
                    Td0[(t0 >>> 24)] ^
                            Td1[(t3 >>> 16) & 0xff] ^
                            Td2[(t2 >>> 8) & 0xff] ^
                            Td3[(t1) & 0xff] ^
                            rdk[k];
            int a1 =
                    Td0[(t1 >>> 24)] ^
                            Td1[(t0 >>> 16) & 0xff] ^
                            Td2[(t3 >>> 8) & 0xff] ^
                            Td3[(t2) & 0xff] ^
                            rdk[k + 1];
            int a2 =
                    Td0[(t2 >>> 24)] ^
                            Td1[(t1 >>> 16) & 0xff] ^
                            Td2[(t0 >>> 8) & 0xff] ^
                            Td3[(t3) & 0xff] ^
                            rdk[k + 2];
            int a3 =
                    Td0[(t3 >>> 24)] ^
                            Td1[(t2 >>> 16) & 0xff] ^
                            Td2[(t1 >>> 8) & 0xff] ^
                            Td3[(t0) & 0xff] ^
                            rdk[k + 3];
            t0 = a0;
            t1 = a1;
            t2 = a2;
            t3 = a3;
        }
        /*
         * last round lacks MixColumn:
         */
        k += 4;

        v = rdk[k];
        pt[0] = (byte) (Sd[(t0 >>> 24)] ^ (v >>> 24));
        pt[1] = (byte) (Sd[(t3 >>> 16) & 0xff] ^ (v >>> 16));
        pt[2] = (byte) (Sd[(t2 >>> 8) & 0xff] ^ (v >>> 8));
        pt[3] = (byte) (Sd[(t1) & 0xff] ^ (v));

        v = rdk[k + 1];
        pt[4] = (byte) (Sd[(t1 >>> 24)] ^ (v >>> 24));
        pt[5] = (byte) (Sd[(t0 >>> 16) & 0xff] ^ (v >>> 16));
        pt[6] = (byte) (Sd[(t3 >>> 8) & 0xff] ^ (v >>> 8));
        pt[7] = (byte) (Sd[(t2) & 0xff] ^ (v));

        v = rdk[k + 2];
        pt[8] = (byte) (Sd[(t2 >>> 24)] ^ (v >>> 24));
        pt[9] = (byte) (Sd[(t1 >>> 16) & 0xff] ^ (v >>> 16));
        pt[10] = (byte) (Sd[(t0 >>> 8) & 0xff] ^ (v >>> 8));
        pt[11] = (byte) (Sd[(t3) & 0xff] ^ (v));

        v = rdk[k + 3];
        pt[12] = (byte) (Sd[(t3 >>> 24)] ^ (v >>> 24));
        pt[13] = (byte) (Sd[(t2 >>> 16) & 0xff] ^ (v >>> 16));
        pt[14] = (byte) (Sd[(t1 >>> 8) & 0xff] ^ (v >>> 8));
        pt[15] = (byte) (Sd[(t0) & 0xff] ^ (v));
    }

    /**
     * Destroy all sensitive information in this object.
     */
    protected final void finalize() {
        if (rek != null) {
            for (int i = 0; i < rek.length; i++) {
                rek[i] = 0;
            }
            rek = null;
        }
        if (rdk != null) {
            for (int i = 0; i < rdk.length; i++) {
                rdk[i] = 0;
            }
            rdk = null;
        }
    }
}


================================================
FILE: library/src/main/java/com/quincysx/crypto/bip39/ByteUtils.java
================================================
package com.quincysx.crypto.bip39;

/**
 * @author QuincySx
 * @date 2018/5/15 上午10:34
 */
final class ByteUtils {
    static int next11Bits(byte[] bytes, int offset) {
        final int skip = offset / 8;
        final int lowerBitsToRemove = (3 * 8 - 11) - (offset % 8);
        return (((int) bytes[skip] & 0xff) << 16 |
                ((int) bytes[skip + 1] & 0xff) << 8 |
                (lowerBitsToRemove < 8
                        ? ((int) bytes[skip + 2] & 0xff)
                        : 0)) >> lowerBitsToRemove & (1 << 11) - 1;
    }

    static void writeNext11(byte[] bytes, int value, int offset) {
        int skip = offset / 8;
        int bitSkip = offset % 8;
        {//byte 0
            byte firstValue = bytes[skip];
            byte toWrite = (byte) (value >> (3 + bitSkip));
            bytes[skip] = (byte) (firstValue | toWrite);
        }

        {//byte 1
            byte valueInByte = bytes[skip + 1];
            final int i = 5 - bitSkip;
            byte toWrite = (byte) (i > 0 ? (value << i) : (value >> -i));
            bytes[skip + 1] = (byte) (valueInByte | toWrite);
        }

        if (bitSkip >= 6) {//byte 2
            byte valueInByte = bytes[skip + 2];
            byte toWrite = (byte) (value << 13 - bitSkip);
            bytes[skip + 2] = (byte) (valueInByte | toWrite);
        }
    }
}


================================================
FILE: library/src/main/java/com/quincysx/crypto/bip39/CharSequenceComparators.java
================================================
package com.quincysx.crypto.bip39;

import java.util.Comparator;

/**
 * @author QuincySx
 * @date 2018/5/15 上午11:25
 */
enum CharSequenceComparators implements Comparator<CharSequence> {

    ALPHABETICAL {
        @Override
        public int compare(final CharSequence o1, final CharSequence o2) {
            final int length1 = o1.length();
            final int length2 = o2.length();
            final int length = Math.min(length1, length2);
            for (int i = 0; i < length; i++) {
                final int compare = Character.compare(o1.charAt(i), o2.charAt(i));
                if (compare != 0) return compare;
            }
            return Integer.compare(length1, length2);
        }
    }

}


================================================
FILE: library/src/main/java/com/quincysx/crypto/bip39/CharSequenceSplitter.java
================================================
package com.quincysx.crypto.bip39;

import java.util.LinkedList;
import java.util.List;

/**
 * @author QuincySx
 * @date 2018/5/15 上午11:15
 */
final class CharSequenceSplitter {
    private final char separator1;
    private final char separator2;

    CharSequenceSplitter(final char separator1, final char separator2) {
        this.separator1 = separator1;
        this.separator2 = separator2;
    }

    List<CharSequence> split(final CharSequence charSequence) {
        final LinkedList<CharSequence> list = new LinkedList<>();
        int start = 0;
        final int length = charSequence.length();
        for (int i = 0; i < length; i++) {
            final char c = charSequence.charAt(i);
            if (c == separator1 || c == separator2) {
                list.add(charSequence.subSequence(start, i));
                start = i + 1;
            }
        }
        list.add(charSequence.subSequence(start, length));
        return list;
    }
}


================================================
FILE: library/src/main/java/com/quincysx/crypto/bip39/MnemonicGenerator.java
================================================
package com.quincysx.crypto.bip39;

import com.quincysx.crypto.utils.SHA256;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * @author QuincySx
 * @date 2018/5/15 上午10:21
 */
public final class MnemonicGenerator {
    private final WordList wordList;

    /**
     * Create a generator using the given word list.
     *
     * @param wordList A known ordered list of 2048 words to select from.
     */
    public MnemonicGenerator(final WordList wordList) {
        this.wordList = wordList;
    }

    public List<String> createMnemonic(
            final CharSequence entropyHex) {
        final int length = entropyHex.length();
        if (length % 2 == 1)
            throw new RuntimeException("Length of hex chars must be divisible by 2");
        final byte[] entropy = new byte[length / 2];
        try {
            for (int i = 0, j = 0; i < length; i += 2, j++) {
                entropy[j] = (byte) (parseHex(entropyHex.charAt(i)) << 4 | parseHex(entropyHex.charAt(i + 1)));
            }
            return createMnemonic(entropy);
        } finally {
            Arrays.fill(entropy, (byte) 0);
        }
    }

    public List<String> createMnemonic(
            final byte[] entropy) {
        final int[] wordIndexes = wordIndexes(entropy);
        try {
            return createMnemonic(wordIndexes);
        } finally {
            Arrays.fill(wordIndexes, 0);
        }
    }

    private List<String> createMnemonic(
            final int[] wordIndexes) {
        List<String> mnemonicList = new ArrayList<>();
        final String space = String.valueOf(wordList.getSpace());
        for (int i = 0; i < wordIndexes.length; i++) {
            mnemonicList.add(wordList.getWord(wordIndexes[i]));
        }
        return mnemonicList;
    }

    private static int[] wordIndexes(byte[] entropy) {
        final int ent = entropy.length * 8;
        entropyLengthPreChecks(ent);

        final byte[] entropyWithChecksum = Arrays.copyOf(entropy, entropy.length + 1);
        entropyWithChecksum[entropy.length] = firstByteOfSha256(entropy);

        //checksum length
        final int cs = ent / 32;
        //mnemonic length
        final int ms = (ent + cs) / 11;

        //get the indexes into the word list
        final int[] wordIndexes = new int[ms];
        for (int i = 0, wi = 0; wi < ms; i += 11, wi++) {
            wordIndexes[wi] = ByteUtils.next11Bits(entropyWithChecksum, i);
        }
        return wordIndexes;
    }

    static byte firstByteOfSha256(final byte[] entropy) {
        final byte[] hash = SHA256.sha256(entropy);
        final byte firstByte = hash[0];
        Arrays.fill(hash, (byte) 0);
        return firstByte;
    }

    private static void entropyLengthPreChecks(final int ent) {
        if (ent < 128)
            throw new RuntimeException("Entropy too low, 128-256 bits allowed");
        if (ent > 256)
            throw new RuntimeException("Entropy too high, 128-256 bits allowed");
        if (ent % 32 > 0)
            throw new RuntimeException("Number of entropy bits must be divisible by 32");
    }

    private static int parseHex(char c) {
        if (c >= '0' && c <= '9') return c - '0';
        if (c >= 'a' && c <= 'f') return (c - 'a') + 10;
        if (c >= 'A' && c <= 'F') return (c - 'A') + 10;
        throw new RuntimeException("Invalid hex char '" + c + '\'');
    }
}


================================================
FILE: library/src/main/java/com/quincysx/crypto/bip39/MnemonicValidator.java
================================================
package com.quincysx.crypto.bip39;

import com.quincysx.crypto.bip39.validation.InvalidChecksumException;
import com.quincysx.crypto.bip39.validation.InvalidWordCountException;
import com.quincysx.crypto.bip39.validation.UnexpectedWhiteSpaceException;
import com.quincysx.crypto.bip39.validation.WordNotFoundException;

import java.util.Arrays;
import java.util.Collection;
import java.util.Comparator;

/**
 * @author QuincySx
 * @date 2018/5/15 上午11:14
 */
public final class MnemonicValidator {
    private final WordAndIndex[] words;
    private final CharSequenceSplitter charSequenceSplitter;
    private final NFKDNormalizer normalizer;

    private MnemonicValidator(final WordList wordList) {
        normalizer = new WordListMapNormalization(wordList);
        words = new WordAndIndex[1 << 11];
        for (int i = 0; i < 1 << 11; i++) {
            words[i] = new WordAndIndex(i, wordList.getWord(i));
        }
        charSequenceSplitter = new CharSequenceSplitter(wordList.getSpace(), Normalization.normalizeNFKD(wordList.getSpace()));
        Arrays.sort(words, wordListSortOrder);
    }

    /**
     * Get a Mnemonic validator for the given word list.
     * No normalization is currently performed, this is an open issue: https://github.com/NovaCrypto/BIP39/issues/13
     *
     * @param wordList A WordList implementation
     * @return A validator
     */
    public static MnemonicValidator ofWordList(final WordList wordList) {
        return new MnemonicValidator(wordList);
    }

    /**
     * Check that the supplied mnemonic fits the BIP0039 spec.
     *
     * @param mnemonic The memorable list of words
     * @throws InvalidChecksumException      If the last bytes don't match the expected last bytes
     * @throws InvalidWordCountException     If the number of words is not a multiple of 3, 24 or fewer
     * @throws WordNotFoundException         If a word in the mnemonic is not present in the word list
     * @throws UnexpectedWhiteSpaceException Occurs if one of the supplied words is empty, e.g. a double space
     */
    public void validate(final CharSequence mnemonic) throws
            InvalidChecksumException,
            InvalidWordCountException,
            WordNotFoundException,
            UnexpectedWhiteSpaceException {
        validate(charSequenceSplitter.split(mnemonic));
    }

    /**
     * Check that the supplied mnemonic fits the BIP0039 spec.
     * <p>
     * The purpose of this method overload is to avoid constructing a mnemonic String if you have gathered a list of
     * words from the user.
     *
     * @param mnemonic The memorable list of words
     * @throws InvalidChecksumException      If the last bytes don't match the expected last bytes
     * @throws InvalidWordCountException     If the number of words is not a multiple of 3, 24 or fewer
     * @throws WordNotFoundException         If a word in the mnemonic is not present in the word list
     * @throws UnexpectedWhiteSpaceException Occurs if one of the supplied words is empty
     */
    public void validate(final Collection<? extends CharSequence> mnemonic) throws
            InvalidChecksumException,
            InvalidWordCountException,
            WordNotFoundException,
            UnexpectedWhiteSpaceException {
        final int[] wordIndexes = findWordIndexes(mnemonic);
        try {
            validate(wordIndexes);
        } finally {
            Arrays.fill(wordIndexes, 0);
        }
    }

    private static void validate(final int[] wordIndexes) throws
            InvalidWordCountException,
            InvalidChecksumException {
        final int ms = wordIndexes.length;

        final int entPlusCs = ms * 11;
        final int ent = (entPlusCs * 32) / 33;
        final int cs = ent / 32;
        if (entPlusCs != ent + cs)
            throw new InvalidWordCountException();
//        final byte[] entropyWithChecksum = new byte[(entPlusCs + 7) / 8];
//
//        wordIndexesToEntropyWithCheckSum(wordIndexes, entropyWithChecksum);
//        Arrays.fill(wordIndexes, 0);
//
//        final byte[] entropy = Arrays.copyOf(entropyWithChecksum, entropyWithChecksum.length - 1);
//        final byte lastByte = entropyWithChecksum[entropyWithChecksum.length - 1];
//        Arrays.fill(entropyWithChecksum, (byte) 0);

//        final byte sha = MnemonicGenerator.firstByteOfSha256(entropy);
//
//        final byte mask = maskOfFirstNBits(cs);
//
//        if (((sha ^ lastByte) & mask) != 0)
//            throw new InvalidChecksumException();
    }

    private int[] findWordIndexes(final Collection<? extends CharSequence> split) throws
            UnexpectedWhiteSpaceException,
            WordNotFoundException {
        final int ms = split.size();
        final int[] result = new int[ms];
        int i = 0;
        for (final CharSequence buffer : split) {
            if (buffer.length() == 0) {
                throw new UnexpectedWhiteSpaceException();
            }
            result[i++] = findWordIndex(buffer);
        }
        return result;
    }

    private int findWordIndex(final CharSequence buffer) throws WordNotFoundException {
        final WordAndIndex key = new WordAndIndex(-1, buffer);
        final int index = Arrays.binarySearch(words, key, wordListSortOrder);
        if (index < 0) {
            final int insertionPoint = -index - 1;
            int suggestion = insertionPoint == 0 ? insertionPoint : insertionPoint - 1;
            if (suggestion + 1 == words.length) suggestion--;
            throw new WordNotFoundException(buffer, words[suggestion].word, words[suggestion + 1].word);

        }
        return words[index].index;
    }

    private static void wordIndexesToEntropyWithCheckSum(final int[] wordIndexes, final byte[] entropyWithChecksum) {
        for (int i = 0, bi = 0; i < wordIndexes.length; i++, bi += 11) {
            ByteUtils.writeNext11(entropyWithChecksum, wordIndexes[i], bi);
        }
    }

    private static byte maskOfFirstNBits(final int n) {
        return (byte) ~((1 << (8 - n)) - 1);
    }

    private static final Comparator<WordAndIndex> wordListSortOrder = new Comparator<WordAndIndex>() {
        @Override
        public int compare(final WordAndIndex o1, final WordAndIndex o2) {
            return CharSequenceComparators.ALPHABETICAL.compare(o1.normalized, o2.normalized);
        }
    };

    private class WordAndIndex {
        final CharSequence word;
        final String normalized;
        final int index;

        WordAndIndex(final int i, final CharSequence word) {
            this.word = word;
            normalized = normalizer.normalize(word);
            index = i;
        }
    }
}


================================================
FILE: library/src/main/java/com/quincysx/crypto/bip39/NFKDNormalizer.java
================================================
package com.quincysx.crypto.bip39;

/**
 * @author QuincySx
 * @date 2018/5/15 上午10:41
 */
public interface NFKDNormalizer {
    String normalize(CharSequence charSequence);
}


================================================
FILE: library/src/main/java/com/quincysx/crypto/bip39/Normalization.java
================================================
package com.quincysx.crypto.bip39;

import java.text.Normalizer;

/**
 * @author QuincySx
 * @date 2018/5/15 上午10:40
 */
final class Normalization {
    static String normalizeNFKD(final String string) {
        return Normalizer.normalize(string, Normalizer.Form.NFKD);
    }

    static char normalizeNFKD(final char c) {
        return normalizeNFKD("" + c).charAt(0);
    }
}


================================================
FILE: library/src/main/java/com/quincysx/crypto/bip39/PBKDF2WithHmacSHA512.java
================================================
package com.quincysx.crypto.bip39;

/**
 * @author QuincySx
 * @date 2018/5/15 上午10:18
 */
public interface PBKDF2WithHmacSHA512 {
    byte[] hash(final char[] chars, final byte[] salt);
}


================================================
FILE: library/src/main/java/com/quincysx/crypto/bip39/RandomSeed.java
================================================
package com.quincysx.crypto.bip39;

import java.security.SecureRandom;
import java.util.Random;

/**
 * @author QuincySx
 * @date 2018/3/13 上午11:06
 */
public class RandomSeed {
    public static byte[] random(WordCount words) {
        return random(words, new SecureRandom());
    }

    public static byte[] random(WordCount words, Random random) {
        byte[] randomSeed = new byte[words.byteLength()];
        random.nextBytes(randomSeed);
        return randomSeed;
    }
}


================================================
FILE: library/src/main/java/com/quincysx/crypto/bip39/SeedCalculator.java
================================================
package com.quincysx.crypto.bip39;

import android.util.Log;

import com.quincysx.crypto.utils.HexUtils;

import java.io.UnsupportedEncodingException;
import java.util.Arrays;
import java.util.List;

import static com.quincysx.crypto.bip39.Normalization.normalizeNFKD;

/**
 * @author QuincySx
 * @date 2018/5/15 上午10:38
 */
public final class SeedCalculator {
    private final byte[] fixedSalt = getUtf8Bytes("mnemonic");
    private final PBKDF2WithHmacSHA512 hashAlgorithm;

    public SeedCalculator(final PBKDF2WithHmacSHA512 hashAlgorithm) {
        this.hashAlgorithm = hashAlgorithm;
    }

    /**
     * Creates a seed calculator using {@link SpongyCastlePBKDF2WithHmacSHA512} which is the most compatible.
     * Use {@link SeedCalculator#SeedCalculator(PBKDF2WithHmacSHA512)} to supply another.
     */
    public SeedCalculator() {
        this(SpongyCastlePBKDF2WithHmacSHA512.INSTANCE);
    }

    public byte[] calculateSeed(final List<String> mnemonicList, final String passphrase) {
        if (mnemonicList == null || mnemonicList.size() < 3) {
            throw new RuntimeException("The dictionary cannot be empty and the number of words must not be less than 3");
        }
        StringBuilder stringBuilder = new StringBuilder();
        for (String str : mnemonicList) {
            stringBuilder.append(str).append(" ");
        }
        String mnemonic = stringBuilder.substring(0, stringBuilder.length() - 1).toString();
        return calculateSeed(mnemonic, passphrase);
    }

    /**
     * Calculate the seed given a mnemonic and corresponding passphrase.
     * The phrase is not checked for validity here, for that use a {@link MnemonicValidator}.
     * <p>
     * Due to normalization, these need to be {@link String}, and not {@link CharSequence}, this is an open issue:
     * https://github.com/NovaCrypto/BIP39/issues/7
     * <p>
     * If you have a list of words selected from a word list, you can use {@link #withWordsFromWordList} then
     * {@link SeedCalculatorByWordListLookUp#calculateSeed}
     *
     * @param mnemonic   The memorable list of words
     * @param passphrase An optional passphrase, use "" if not required
     * @return a seed for HD wallet generation
     */
    public byte[] calculateSeed(final String mnemonic, final String passphrase) {
        final char[] chars = normalizeNFKD(mnemonic).toCharArray();
        try {
            return calculateSeed(chars, passphrase);
        } finally {
            Arrays.fill(chars, '\0');
        }
    }

    byte[] calculateSeed(final char[] mnemonicChars, final String passphrase) {
        final String normalizedPassphrase = normalizeNFKD(passphrase);
        final byte[] salt2 = getUtf8Bytes(normalizedPassphrase);
        final byte[] salt = combine(fixedSalt, salt2);
        clear(salt2);
        final byte[] encoded = hash(mnemonicChars, salt);
        clear(salt);
        return encoded;
    }

    public SeedCalculatorByWordListLookUp withWordsFromWordList(final WordList wordList) {
        return new SeedCalculatorByWordListLookUp(this, wordList);
    }

    private static byte[] combine(final byte[] array1, final byte[] array2) {
        final byte[] bytes = new byte[array1.length + array2.length];
        System.arraycopy(array1, 0, bytes, 0, array1.length);
        System.arraycopy(array2, 0, bytes, array1.length, bytes.length - array1.length);
        return bytes;
    }

    private static void clear(final byte[] salt) {
        Arrays.fill(salt, (byte) 0);
    }

    private byte[] hash(final char[] chars, final byte[] salt) {
        return hashAlgorithm.hash(chars, salt);
    }

    private static byte[] getUtf8Bytes(final String string) {
        try {
            return string.getBytes("UTF-8");
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        return null;
    }
}


================================================
FILE: library/src/main/java/com/quincysx/crypto/bip39/SeedCalculatorByWordListLookUp.java
================================================
package com.quincysx.crypto.bip39;

import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;

/**
 * @author QuincySx
 * @date 2018/5/15 上午10:39
 */
public final class SeedCalculatorByWordListLookUp {
    private final SeedCalculator seedCalculator;
    private final Map<CharSequence, char[]> map = new HashMap<>();
    private final NFKDNormalizer normalizer;

    SeedCalculatorByWordListLookUp(final SeedCalculator seedCalculator, final WordList wordList) {
        this.seedCalculator = seedCalculator;
        normalizer = new WordListMapNormalization(wordList);
        for (int i = 0; i < 1 << 11; i++) {
            final String word = normalizer.normalize(wordList.getWord(i));
            map.put(word, word.toCharArray());
        }
    }

    /**
     * Calculate the seed given a mnemonic and corresponding passphrase.
     * The phrase is not checked for validity here, for that use a {@link MnemonicValidator}.
     * <p>
     * The purpose of this method is to avoid constructing a mnemonic String if you have gathered a list of
     * words from the user and also to avoid having to normalize it, all words in the {@link WordList} are normalized
     * instead.
     * <p>
     * Due to normalization, the passphrase still needs to be {@link String}, and not {@link CharSequence}, this is an
     * open issue: https://github.com/NovaCrypto/BIP39/issues/7
     *
     * @param mnemonic   The memorable list of words, ideally selected from the word list that was supplied while creating this object.
     * @param passphrase An optional passphrase, use "" if not required
     * @return a seed for HD wallet generation
     */
    public byte[] calculateSeed(final Collection<? extends CharSequence> mnemonic, final String passphrase) {
        final int words = mnemonic.size();
        final char[][] chars = new char[words][];
        final List<char[]> toClear = new LinkedList<>();
        int count = 0;
        int wordIndex = 0;
        for (final CharSequence word : mnemonic) {
            char[] wordChars = map.get(normalizer.normalize(word));
            if (wordChars == null) {
                wordChars = normalizer.normalize(word).toCharArray();
                toClear.add(wordChars);
            }
            chars[wordIndex++] = wordChars;
            count += wordChars.length;
        }
        count += words - 1;
        final char[] mnemonicChars = new char[count];
        try {
            int index = 0;
            for (int i = 0; i < chars.length; i++) {
                System.arraycopy(chars[i], 0, mnemonicChars, index, chars[i].length);
                index += chars[i].length;
                if (i < chars.length - 1) {
                    mnemonicChars[index++] = ' ';
                }
            }
            return seedCalculator.calculateSeed(mnemonicChars, passphrase);
        } finally {
            Arrays.fill(mnemonicChars, '\0');
            Arrays.fill(chars, null);
            for (final char[] charsToClear : toClear)
                Arrays.fill(charsToClear, '\0');
        }
    }
}


================================================
FILE: library/src/main/java/com/quincysx/crypto/bip39/SpongyCastlePBKDF2WithHmacSHA512.java
================================================
package com.quincysx.crypto.bip39;

import org.spongycastle.crypto.PBEParametersGenerator;
import org.spongycastle.crypto.digests.SHA512Digest;
import org.spongycastle.crypto.generators.PKCS5S2ParametersGenerator;
import org.spongycastle.crypto.params.KeyParameter;

/**
 * @author QuincySx
 * @date 2018/5/15 上午10:20
 */
public enum SpongyCastlePBKDF2WithHmacSHA512 implements PBKDF2WithHmacSHA512 {
    INSTANCE;

    @Override
    public byte[] hash(char[] chars, byte[] salt) {
        PKCS5S2ParametersGenerator generator = new PKCS5S2ParametersGenerator(new SHA512Digest());
        generator.init(PBEParametersGenerator.PKCS5PasswordToUTF8Bytes(chars), salt, 2048);
        KeyParameter key = (KeyParameter) generator.generateDerivedMacParameters(512);
        return key.getKey();
    }
}


================================================
FILE: library/src/main/java/com/quincysx/crypto/bip39/WordCount.java
================================================
package com.quincysx.crypto.bip39;

/**
 * @author QuincySx
 * @date 2018/3/2 下午4:27
 * 词语个数的枚举
 */
public enum WordCount {
    /**
     * 3个助记词
     */
//    THREE(27),
    /**
     * 6个助记词
     */
//    SIX(54),
    /**
     * 9个助记词
     */
//    NINE(72),
    /**
     * 12个助记词
     */
    TWELVE(128),
    /**
     * 15个助记词
     */
    FIFTEEN(160),
    /**
     * 18个助记词
     */
    EIGHTEEN(192),
    /**
     * 21个助记词
     */
    TWENTY_ONE(224),
    /**
     * 24个助记词
     */
    TWENTY_FOUR(256);

    private final int bitLength;

    WordCount(int bitLength) {
        this.bitLength = bitLength;
    }

    public int bitLength() {
        return bitLength;
    }

    public int byteLength() {
        return bitLength / 8;
    }
}


================================================
FILE: library/src/main/java/com/quincysx/crypto/bip39/WordList.java
================================================
/*
 *  BIP39 library, a Java implementation of BIP39
 *  Copyright (C) 2017 Alan Evans, NovaCrypto
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <https://www.gnu.org/licenses/>.
 *
 *  Original source: https://github.com/NovaCrypto/BIP39
 *  You can contact the authors via github issues.
 */

package com.quincysx.crypto.bip39;

public interface WordList {

    /**
     * Get a word in the word list.
     *
     * @param index Index of word in the word list [0..2047] inclusive.
     * @return the word from the list.
     */
    String getWord(final int index);

    int getIndex(final String word);

    /**
     * Get the space character for this language.
     *
     * @return a whitespace character.
     */
    char getSpace();
}

================================================
FILE: library/src/main/java/com/quincysx/crypto/bip39/WordListMapNormalization.java
================================================
package com.quincysx.crypto.bip39;

import java.text.Normalizer;
import java.util.HashMap;
import java.util.Map;

/**
 * @author QuincySx
 * @date 2018/5/15 上午10:41
 */
public class WordListMapNormalization implements NFKDNormalizer {
    private final Map<CharSequence, String> normalizedMap = new HashMap<>();

    WordListMapNormalization(final WordList wordList) {
        for (int i = 0; i < 1 << 11; i++) {
            final String word = wordList.getWord(i);
            final String normalized = Normalizer.normalize(word, Normalizer.Form.NFKD);
            normalizedMap.put(word, normalized);
            normalizedMap.put(normalized, normalized);
            normalizedMap.put(Normalizer.normalize(word, Normalizer.Form.NFC), normalized);
        }
    }

    @Override
    public String normalize(final CharSequence charSequence) {
        final String normalized = normalizedMap.get(charSequence);
        if (normalized != null)
            return normalized;
        return Normalizer.normalize(charSequence, Normalizer.Form.NFKD);
    }
}


================================================
FILE: library/src/main/java/com/quincysx/crypto/bip39/exception/MnemonicException.java
================================================
/*
 *
 *  * Copyright 2014 http://Bither.net
 *  *
 *  * Licensed under the Apache License, Version 2.0 (the "License");
 *  * you may not use this file except in compliance with the License.
 *  * You may obtain a copy of the License at
 *  *
 *  *    http://www.apache.org/licenses/LICENSE-2.0
 *  *
 *  * Unless required by applicable law or agreed to in writing, software
 *  * distributed under the License is distributed on an "AS IS" BASIS,
 *  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  * See the License for the specific language governing permissions and
 *  * limitations under the License.
 *
 */

package com.quincysx.crypto.bip39.exception;

/**
 * Exceptions thrown by the MnemonicCode module.
 */
@SuppressWarnings("serial")
public class MnemonicException extends Exception {
    public MnemonicException() {
        super();
    }

    public MnemonicException(String msg) {
        super(msg);
    }

    /**
     * Thrown when an argument to MnemonicCode is the wrong length.
     */
    public static class MnemonicLengthException extends MnemonicException {
        public MnemonicLengthException(String msg) {
            super(msg);
        }
    }

    /**
     * Thrown when a list of MnemonicCode words fails the checksum check.
     */
    public static class MnemonicChecksumException extends MnemonicException {
        public MnemonicChecksumException() {
            super();
        }
    }

    /**
     * Thrown when a word is encountered which is not in the MnemonicCode's word list.
     */
    public static class MnemonicWordException extends MnemonicException {
        /**
         * Contains the word that was not found in the word list.
         */
        public final String badWord;

        public MnemonicWordException(String badWord) {
            super();
            this.badWord = badWord;
        }
    }
}


================================================
FILE: library/src/main/java/com/quincysx/crypto/bip39/validation/InvalidChecksumException.java
================================================
package com.quincysx.crypto.bip39.validation;

/**
 * @author QuincySx
 * @date 2018/5/15 上午11:19
 */
public class InvalidChecksumException extends Exception {
    public InvalidChecksumException() {
        super("Invalid checksum");
    }
}


================================================
FILE: library/src/main/java/com/quincysx/crypto/bip39/validation/InvalidWordCountException.java
================================================
package com.quincysx.crypto.bip39.validation;

/**
 * @author QuincySx
 * @date 2018/5/15 上午11:20
 */
public class InvalidWordCountException extends Exception {
    public InvalidWordCountException() {
        super("Not a correct number of words");
    }
}


================================================
FILE: library/src/main/java/com/quincysx/crypto/bip39/validation/UnexpectedWhiteSpaceException.java
================================================
package com.quincysx.crypto.bip39.validation;

/**
 * @author QuincySx
 * @date 2018/5/15 上午11:20
 */
public class UnexpectedWhiteSpaceException extends Exception {
    public UnexpectedWhiteSpaceException() {
        super("Unexpected whitespace");
    }
}


================================================
FILE: library/src/main/java/com/quincysx/crypto/bip39/validation/WordNotFoundException.java
================================================
package com.quincysx.crypto.bip39.validation;

/**
 * @author QuincySx
 * @date 2018/5/15 上午11:20
 */
public class WordNotFoundException extends Exception {
    private final CharSequence word;
    private final CharSequence suggestion1;
    private final CharSequence suggestion2;

    public WordNotFoundException(
            final CharSequence word,
            final CharSequence suggestion1,
            final CharSequence suggestion2) {
        super(String.format(
                "Word not found in word list \"%s\", suggestions \"%s\", \"%s\"",
                word,
                suggestion1,
                suggestion2));
        this.word = word;
        this.suggestion1 = suggestion1;
        this.suggestion2 = suggestion2;
    }

    public CharSequence getWord() {
        return word;
    }

    public CharSequence getSuggestion1() {
        return suggestion1;
    }

    public CharSequence getSuggestion2() {
        return suggestion2;
    }
}


================================================
FILE: library/src/main/java/com/quincysx/crypto/bip39/wordlists/English.java
================================================
/*
 *  BIP39 library, a Java implementation of BIP39
 *  Copyright (C) 2017 Alan Evans, NovaCrypto
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <https://www.gnu.org/licenses/>.
 *
 *  Original source: https://github.com/NovaCrypto/BIP39
 *  You can contact the authors via github issues.
 */

package com.quincysx.crypto.bip39.wordlists;


import com.quincysx.crypto.bip39.WordList;

/**
 * Source: https://github.com/bitcoin/bips/blob/master/bip-0039/english.txt
 */
public enum English implements WordList {
    INSTANCE;

    @Override
    public String getWord(final int index) {
        return words[index];
    }

    @Override
    public int getIndex(final String word) {
        int size = words.length;
        if (word == null) {
            for (int i = 0; i < size; i++)
                if (words[i] == null)
                    return i;
        } else {
            for (int i = 0; i < size; i++)
                if (word.equals(words[i]))
                    return i;
        }
        return -1;
    }

    @Override
    public char getSpace() {
        return ' ';
    }

    private final static String[] words = new String[]{
            "abandon",
            "ability",
            "able",
            "about",
            "above",
            "absent",
            "absorb",
            "abstract",
            "absurd",
            "abuse",
            "access",
            "accident",
            "account",
            "accuse",
            "achieve",
            "acid",
            "acoustic",
            "acquire",
            "across",
            "act",
            "action",
            "actor",
            "actress",
            "actual",
            "adapt",
            "add",
            "addict",
            "address",
            "adjust",
            "admit",
            "adult",
            "advance",
            "advice",
            "aerobic",
            "affair",
            "afford",
            "afraid",
            "again",
            "age",
            "agent",
            "agree",
            "ahead",
            "aim",
            "air",
            "airport",
            "aisle",
            "alarm",
            "album",
            "alcohol",
            "alert",
            "alien",
            "all",
            "alley",
            "allow",
            "almost",
            "alone",
            "alpha",
            "already",
            "also",
            "alter",
            "always",
            "amateur",
            "amazing",
            "among",
            "amount",
            "amused",
            "analyst",
            "anchor",
            "ancient",
            "anger",
            "angle",
            "angry",
            "animal",
            "ankle",
            "announce",
            "annual",
            "another",
            "answer",
            "antenna",
            "antique",
            "anxiety",
            "any",
            "apart",
            "apology",
            "appear",
            "apple",
            "approve",
            "april",
            "arch",
            "arctic",
            "area",
            "arena",
            "argue",
            "arm",
            "armed",
            "armor",
            "army",
            "around",
            "arrange",
            "arrest",
            "arrive",
            "arrow",
            "art",
            "artefact",
            "artist",
            "artwork",
            "ask",
            "aspect",
            "assault",
            "asset",
            "assist",
            "assume",
            "asthma",
            "athlete",
            "atom",
            "attack",
            "attend",
            "attitude",
            "attract",
            "auction",
            "audit",
            "august",
            "aunt",
            "author",
            "auto",
            "autumn",
            "average",
            "avocado",
            "avoid",
            "awake",
            "aware",
            "away",
            "awesome",
            "awful",
            "awkward",
            "axis",
            "baby",
            "bachelor",
            "bacon",
            "badge",
            "bag",
            "balance",
            "balcony",
            "ball",
            "bamboo",
            "banana",
            "banner",
            "bar",
            "barely",
            "bargain",
            "barrel",
            "base",
            "basic",
            "basket",
            "battle",
            "beach",
            "bean",
            "beauty",
            "because",
            "become",
            "beef",
            "before",
            "begin",
            "behave",
            "behind",
            "believe",
            "below",
            "belt",
            "bench",
            "benefit",
            "best",
            "betray",
            "better",
            "between",
            "beyond",
            "bicycle",
            "bid",
            "bike",
            "bind",
            "biology",
            "bird",
            "birth",
            "bitter",
            "black",
            "blade",
            "blame",
            "blanket",
            "blast",
            "bleak",
            "bless",
            "blind",
            "blood",
            "blossom",
            "blouse",
            "blue",
            "blur",
            "blush",
            "board",
            "boat",
            "body",
            "boil",
            "bomb",
            "bone",
            "bonus",
            "book",
            "boost",
            "border",
            "boring",
            "borrow",
            "boss",
            "bottom",
            "bounce",
            "box",
            "boy",
            "bracket",
            "brain",
            "brand",
            "brass",
            "brave",
            "bread",
            "breeze",
            "brick",
            "bridge",
            "brief",
            "bright",
            "bring",
            "brisk",
            "broccoli",
            "broken",
            "bronze",
            "broom",
            "brother",
            "brown",
            "brush",
            "bubble",
            "buddy",
            "budget",
            "buffalo",
            "build",
            "bulb",
            "bulk",
            "bullet",
            "bundle",
            "bunker",
            "burden",
            "burger",
            "burst",
            "bus",
            "business",
            "busy",
            "butter",
            "buyer",
            "buzz",
            "cabbage",
            "cabin",
            "cable",
            "cactus",
            "cage",
            "cake",
            "call",
            "calm",
            "camera",
            "camp",
            "can",
            "canal",
            "cancel",
            "candy",
            "cannon",
            "canoe",
            "canvas",
            "canyon",
            "capable",
            "capital",
            "captain",
            "car",
            "carbon",
            "card",
            "cargo",
            "carpet",
            "carry",
            "cart",
            "case",
            "cash",
            "casino",
            "castle",
            "casual",
            "cat",
            "catalog",
            "catch",
            "category",
            "cattle",
            "caught",
            "cause",
            "caution",
            "cave",
            "ceiling",
            "celery",
            "cement",
            "census",
            "century",
            "cereal",
            "certain",
            "chair",
            "chalk",
            "champion",
            "change",
            "chaos",
            "chapter",
            "charge",
            "chase",
            "chat",
            "cheap",
            "check",
            "cheese",
            "chef",
            "cherry",
            "chest",
            "chicken",
            "chief",
            "child",
            "chimney",
            "choice",
            "choose",
            "chronic",
            "chuckle",
            "chunk",
            "churn",
            "cigar",
            "cinnamon",
            "circle",
            "citizen",
            "city",
            "civil",
            "claim",
            "clap",
            "clarify",
            "claw",
            "clay",
            "clean",
            "clerk",
            "clever",
            "click",
            "client",
            "cliff",
            "climb",
            "clinic",
            "clip",
            "clock",
            "clog",
            "close",
            "cloth",
            "cloud",
            "clown",
            "club",
            "clump",
            "cluster",
            "clutch",
            "coach",
            "coast",
            "coconut",
            "code",
            "coffee",
            "coil",
            "coin",
            "collect",
            "color",
            "column",
            "combine",
            "come",
            "comfort",
            "comic",
            "common",
            "company",
            "concert",
            "conduct",
            "confirm",
            "congress",
            "connect",
            "consider",
            "control",
            "convince",
            "cook",
            "cool",
            "copper",
            "copy",
            "coral",
            "core",
            "corn",
            "correct",
            "cost",
            "cotton",
            "couch",
            "country",
            "couple",
            "course",
            "cousin",
            "cover",
            "coyote",
            "crack",
            "cradle",
            "craft",
            "cram",
            "crane",
            "crash",
            "crater",
            "crawl",
            "crazy",
            "cream",
            "credit",
            "creek",
            "crew",
            "cricket",
            "crime",
            "crisp",
            "critic",
            "crop",
            "cross",
            "crouch",
            "crowd",
            "crucial",
            "cruel",
            "cruise",
            "crumble",
            "crunch",
            "crush",
            "cry",
            "crystal",
            "cube",
            "culture",
            "cup",
            "cupboard",
            "curious",
            "current",
            "curtain",
            "curve",
            "cushion",
            "custom",
            "cute",
            "cycle",
            "dad",
            "damage",
            "damp",
            "dance",
            "danger",
            "daring",
            "dash",
            "daughter",
            "dawn",
            "day",
            "deal",
            "debate",
            "debris",
            "decade",
            "december",
            "decide",
            "decline",
            "decorate",
            "decrease",
            "deer",
            "defense",
            "define",
            "defy",
            "degree",
            "delay",
            "deliver",
            "demand",
            "demise",
            "denial",
            "dentist",
            "deny",
            "depart",
            "depend",
            "deposit",
            "depth",
            "deputy",
            "derive",
            "describe",
            "desert",
            "design",
            "desk",
            "despair",
            "destroy",
            "detail",
            "detect",
            "develop",
            "device",
            "devote",
            "diagram",
            "dial",
            "diamond",
            "diary",
            "dice",
            "diesel",
            "diet",
            "differ",
            "digital",
            "dignity",
            "dilemma",
            "dinner",
            "dinosaur",
            "direct",
            "dirt",
            "disagree",
            "discover",
            "disease",
            "dish",
            "dismiss",
            "disorder",
            "display",
            "distance",
            "divert",
            "divide",
            "divorce",
            "dizzy",
            "doctor",
            "document",
            "dog",
            "doll",
            "dolphin",
            "domain",
            "donate",
            "donkey",
            "donor",
            "door",
            "dose",
            "double",
            "dove",
            "draft",
            "dragon",
            "drama",
            "drastic",
            "draw",
            "dream",
            "dress",
            "drift",
            "drill",
            "drink",
            "drip",
            "drive",
            "drop",
            "drum",
            "dry",
            "duck",
            "dumb",
            "dune",
            "during",
            "dust",
            "dutch",
            "duty",
            "dwarf",
            "dynamic",
            "eager",
            "eagle",
            "early",
            "earn",
            "earth",
            "easily",
            "east",
            "easy",
            "echo",
            "ecology",
            "economy",
            "edge",
            "edit",
            "educate",
            "effort",
            "egg",
            "eight",
            "either",
            "elbow",
            "elder",
            "electric",
            "elegant",
            "element",
            "elephant",
            "elevator",
            "elite",
            "else",
            "embark",
            "embody",
            "embrace",
            "emerge",
            "emotion",
            "employ",
            "empower",
            "empty",
            "enable",
            "enact",
            "end",
            "endless",
            "endorse",
            "enemy",
            "energy",
            "enforce",
            "engage",
            "engine",
            "enhance",
            "enjoy",
            "enlist",
            "enough",
            "enrich",
            "enroll",
            "ensure",
            "enter",
            "entire",
            "entry",
            "envelope",
            "episode",
            "equal",
            "equip",
            "era",
            "erase",
            "erode",
            "erosion",
            "error",
            "erupt",
            "escape",
            "essay",
            "essence",
            "estate",
            "eternal",
            "ethics",
            "evidence",
            "evil",
            "evoke",
            "evolve",
            "exact",
            "example",
            "excess",
            "exchange",
            "excite",
            "exclude",
            "excuse",
            "execute",
            "exercise",
            "exhaust",
            "exhibit",
            "exile",
            "exist",
            "exit",
            "exotic",
            "expand",
            "expect",
            "expire",
            "explain",
            "expose",
            "express",
            "extend",
            "extra",
            "eye",
            "eyebrow",
            "fabric",
            "face",
            "faculty",
            "fade",
            "faint",
            "faith",
            "fall",
            "false",
            "fame",
            "family",
            "famous",
            "fan",
            "fancy",
            "fantasy",
            "farm",
            "fashion",
            "fat",
            "fatal",
            "father",
            "fatigue",
            "fault",
            "favorite",
            "feature",
            "february",
            "federal",
            "fee",
            "feed",
            "feel",
            "female",
            "fence",
            "festival",
            "fetch",
            "fever",
            "few",
            "fiber",
            "fiction",
            "field",
            "figure",
            "file",
            "film",
            "filter",
            "final",
            "find",
            "fine",
            "finger",
            "finish",
            "fire",
            "firm",
            "first",
            "fiscal",
            "fish",
            "fit",
            "fitness",
            "fix",
            "flag",
            "flame",
            "flash",
            "flat",
            "flavor",
            "flee",
            "flight",
            "flip",
            "float",
            "flock",
            "floor",
            "flower",
            "fluid",
            "flush",
            "fly",
            "foam",
            "focus",
            "fog",
            "foil",
            "fold",
            "follow",
            "food",
            "foot",
            "force",
            "forest",
            "forget",
            "fork",
            "fortune",
            "forum",
            "forward",
            "fossil",
            "foster",
            "found",
            "fox",
            "fragile",
            "frame",
            "frequent",
            "fresh",
            "friend",
            "fringe",
            "frog",
            "front",
            "frost",
            "frown",
            "frozen",
            "fruit",
            "fuel",
            "fun",
            "funny",
            "furnace",
            "fury",
            "future",
            "gadget",
            "gain",
            "galaxy",
            "gallery",
            "game",
            "gap",
            "garage",
            "garbage",
            "garden",
            "garlic",
            "garment",
            "gas",
            "gasp",
            "gate",
            "gather",
            "gauge",
            "gaze",
            "general",
            "genius",
            "genre",
            "gentle",
            "genuine",
            "gesture",
            "ghost",
            "giant",
            "gift",
            "giggle",
            "ginger",
            "giraffe",
            "girl",
            "give",
            "glad",
            "glance",
            "glare",
            "glass",
            "glide",
            "glimpse",
            "globe",
            "gloom",
            "glory",
            "glove",
            "glow",
            "glue",
            "goat",
            "goddess",
            "gold",
            "good",
            "goose",
            "gorilla",
            "gospel",
            "gossip",
            "govern",
            "gown",
            "grab",
            "grace",
            "grain",
            "grant",
            "grape",
            "grass",
            "gravity",
            "great",
            "green",
            "grid",
            "grief",
            "grit",
            "grocery",
            "group",
            "grow",
            "grunt",
            "guard",
            "guess",
            "guide",
            "guilt",
            "guitar",
            "gun",
            "gym",
            "habit",
            "hair",
            "half",
            "hammer",
            "hamster",
            "hand",
            "happy",
            "harbor",
            "hard",
            "harsh",
            "harvest",
            "hat",
            "have",
            "hawk",
            "hazard",
            "head",
            "health",
            "heart",
            "heavy",
            "hedgehog",
            "height",
            "hello",
            "helmet",
            "help",
            "hen",
            "hero",
            "hidden",
            "high",
            "hill",
            "hint",
            "hip",
            "hire",
            "history",
            "hobby",
            "hockey",
            "hold",
            "hole",
            "holiday",
            "hollow",
            "home",
            "honey",
            "hood",
            "hope",
            "horn",
            "horror",
            "horse",
            "hospital",
            "host",
            "hotel",
            "hour",
            "hover",
            "hub",
            "huge",
            "human",
            "humble",
            "humor",
            "hundred",
            "hungry",
            "hunt",
            "hurdle",
            "hurry",
            "hurt",
            "husband",
            "hybrid",
            "ice",
            "icon",
            "idea",
            "identify",
            "idle",
            "ignore",
            "ill",
            "illegal",
            "illness",
            "image",
            "imitate",
            "immense",
            "immune",
            "impact",
            "impose",
            "improve",
            "impulse",
            "inch",
            "include",
            "income",
            "increase",
            "index",
            "indicate",
            "indoor",
            "industry",
            "infant",
            "inflict",
            "inform",
            "inhale",
            "inherit",
            "initial",
            "inject",
            "injury",
            "inmate",
            "inner",
            "innocent",
            "input",
            "inquiry",
            "insane",
            "insect",
            "inside",
            "inspire",
            "install",
            "intact",
            "interest",
            "into",
            "invest",
            "invite",
            "involve",
            "iron",
            "island",
            "isolate",
            "issue",
            "item",
            "ivory",
            "jacket",
            "jaguar",
            "jar",
            "jazz",
            "jealous",
            "jeans",
            "jelly",
            "jewel",
            "job",
            "join",
            "joke",
            "journey",
            "joy",
            "judge",
            "juice",
            "jump",
            "jungle",
            "junior",
            "junk",
            "just",
            "kangaroo",
            "keen",
            "keep",
            "ketchup",
            "key",
            "kick",
            "kid",
            "kidney",
            "kind",
            "kingdom",
            "kiss",
            "kit",
            "kitchen",
            "kite",
            "kitten",
            "kiwi",
            "knee",
            "knife",
            "knock",
            "know",
            "lab",
            "label",
            "labor",
            "ladder",
            "lady",
            "lake",
            "lamp",
            "language",
            "laptop",
            "large",
            "later",
            "latin",
            "laugh",
            "laundry",
            "lava",
            "law",
            "lawn",
            "lawsuit",
            "layer",
            "lazy",
            "leader",
            "leaf",
            "learn",
            "leave",
            "lecture",
            "left",
            "leg",
            "legal",
            "legend",
            "leisure",
            "lemon",
            "lend",
            "length",
            "lens",
            "leopard",
            "lesson",
            "letter",
            "level",
            "liar",
            "liberty",
            "library",
            "license",
            "life",
            "lift",
            "light",
            "like",
            "limb",
            "limit",
            "link",
            "lion",
            "liquid",
            "list",
            "little",
            "live",
            "lizard",
            "load",
            "loan",
            "lobster",
            "local",
            "lock",
            "logic",
            "lonely",
            "long",
            "loop",
            "lottery",
            "loud",
            "lounge",
            "love",
            "loyal",
            "lucky",
            "luggage",
            "lumber",
            "lunar",
            "lunch",
            "luxury",
            "lyrics",
            "machine",
            "mad",
            "magic",
            "magnet",
            "maid",
            "mail",
            "main",
            "major",
            "make",
            "mammal",
            "man",
            "manage",
            "mandate",
            "mango",
            "mansion",
            "manual",
            "maple",
            "marble",
            "march",
            "margin",
            "marine",
            "market",
            "marriage",
            "mask",
            "mass",
            "master",
            "match",
            "material",
            "math",
            "matrix",
            "matter",
            "maximum",
            "maze",
            "meadow",
            "mean",
            "measure",
            "meat",
            "mechanic",
            "medal",
            "media",
            "melody",
            "melt",
            "member",
            "memory",
            "mention",
            "menu",
            "mercy",
            "merge",
            "merit",
            "merry",
            "mesh",
            "message",
            "metal",
            "method",
            "middle",
            "midnight",
            "milk",
            "million",
            "mimic",
            "mind",
            "minimum",
            "minor",
            "minute",
            "miracle",
            "mirror",
            "misery",
            "miss",
            "mistake",
            "mix",
            "mixed",
            "mixture",
            "mobile",
            "model",
            "modify",
            "mom",
            "moment",
            "monitor",
            "monkey",
            "monster",
            "month",
            "moon",
            "moral",
            "more",
            "morning",
            "mosquito",
            "mother",
            "motion",
            "motor",
            "mountain",
            "mouse",
            "move",
            "movie",
            "much",
            "muffin",
            "mule",
            "multiply",
            "muscle",
            "museum",
            "mushroom",
            "music",
            "must",
            "mutual",
            "myself",
            "mystery",
            "myth",
            "naive",
            "name",
            "napkin",
            "narrow",
            "nasty",
            "nation",
            "nature",
            "near",
            "neck",
            "need",
            "negative",
            "neglect",
            "neither",
            "nephew",
            "nerve",
            "nest",
            "net",
            "network",
            "neutral",
            "never",
            "news",
            "next",
            "nice",
            "night",
            "noble",
            "noise",
            "nominee",
            "noodle",
            "normal",
            "north",
            "nose",
            "notable",
            "note",
            "nothing",
            "notice",
            "novel",
            "now",
            "nuclear",
            "number",
            "nurse",
            "nut",
            "oak",
            "obey",
            "object",
            "oblige",
            "obscure",
            "observe",
            "obtain",
            "obvious",
            "occur",
            "ocean",
            "october",
            "odor",
            "off",
            "offer",
            "office",
            "often",
            "oil",
            "okay",
            "old",
            "olive",
            "olympic",
            "omit",
            "once",
            "one",
            "onion",
            "online",
            "only",
            "open",
            "opera",
            "opinion",
            "oppose",
            "option",
            "orange",
            "orbit",
            "orchard",
            "order",
            "ordinary",
            "organ",
            "orient",
            "original",
            "orphan",
            "ostrich",
            "other",
            "outdoor",
            "outer",
            "output",
            "outside",
            "oval",
            "oven",
            "over",
            "own",
            "owner",
            "oxygen",
            "oyster",
            "ozone",
            "pact",
            "paddle",
            "page",
            "pair",
            "palace",
            "palm",
            "panda",
            "panel",
            "panic",
            "panther",
            "paper",
            "parade",
            "parent",
            "park",
            "parrot",
            "party",
            "pass",
            "patch",
            "path",
            "patient",
            "patrol",
            "pattern",
            "pause",
            "pave",
            "payment",
            "peace",
            "peanut",
            "pear",
            "peasant",
            "pelican",
            "pen",
            "penalty",
            "pencil",
            "people",
            "pepper",
            "perfect",
            "permit",
            "person",
            "pet",
            "phone",
            "photo",
            "phrase",
            "physical",
            "piano",
            "picnic",
            "picture",
            "piece",
            "pig",
            "pigeon",
            "pill",
            "pilot",
            "pink",
            "pioneer",
            "pipe",
            "pistol",
            "pitch",
            "pizza",
            "place",
            "planet",
            "plastic",
            "plate",
            "play",
            "please",
            "pledge",
            "pluck",
            "plug",
            "plunge",
            "poem",
            "poet",
            "point",
            "polar",
            "pole",
            "police",
            "pond",
            "pony",
            "pool",
            "popular",
            "portion",
            "position",
            "possible",
            "post",
            "potato",
            "pottery",
            "poverty",
            "powder",
            "power",
            "practice",
            "praise",
            "predict",
            "prefer",
            "prepare",
            "present",
            "pretty",
            "prevent",
            "price",
            "pride",
            "primary",
            "print",
            "priority",
            "prison",
            "private",
            "prize",
            "problem",
            "process",
            "produce",
            "profit",
            "program",
            "project",
            "promote",
            "proof",
            "property",
            "prosper",
            "protect",
            "proud",
            "provide",
            "public",
            "pudding",
            "pull",
            "pulp",
            "pulse",
            "pumpkin",
            "punch",
            "pupil",
            "puppy",
            "purchase",
            "purity",
            "purpose",
            "purse",
            "push",
            "put",
            "puzzle",
            "pyramid",
            "quality",
            "quantum",
            "quarter",
            "question",
            "quick",
            "quit",
            "quiz",
            "quote",
            "rabbit",
            "raccoon",
            "race",
            "rack",
            "radar",
            "radio",
            "rail",
            "rain",
            "raise",
            "rally",
            "ramp",
            "ranch",
            "random",
            "range",
            "rapid",
            "rare",
            "rate",
            "rather",
            "raven",
            "raw",
            "razor",
            "ready",
            "real",
            "reason",
            "rebel",
            "rebuild",
            "recall",
            "receive",
            "recipe",
            "record",
            "recycle",
            "reduce",
            "reflect",
            "reform",
            "refuse",
            "region",
            "regret",
            "regular",
            "reject",
            "relax",
            "release",
            "relief",
            "rely",
            "remain",
            "remember",
            "remind",
            "remove",
            "render",
            "renew",
            "rent",
            "reopen",
            "repair",
            "repeat",
            "replace",
            "report",
            "require",
            "rescue",
            "resemble",
            "resist",
            "resource",
            "response",
            "result",
            "retire",
            "retreat",
            "return",
            "reunion",
            "reveal",
            "review",
            "reward",
            "rhythm",
            "rib",
            "ribbon",
            "rice",
            "rich",
            "ride",
            "ridge",
            "rifle",
            "right",
            "rigid",
            "ring",
            "riot",
            "ripple",
            "risk",
            "ritual",
            "rival",
            "river",
            "road",
            "roast",
            "robot",
            "robust",
            "rocket",
            "romance",
            "roof",
            "rookie",
            "room",
            "rose",
            "rotate",
            "rough",
            "round",
            "route",
            "royal",
            "rubber",
            "rude",
            "rug",
            "rule",
            "run",
            "runway",
            "rural",
            "sad",
            "saddle",
            "sadness",
            "safe",
            "sail",
            "salad",
            "salmon",
            "salon",
            "salt",
            "salute",
            "same",
            "sample",
            "sand",
            "satisfy",
            "satoshi",
            "sauce",
            "sausage",
            "save",
            "say",
            "scale",
            "scan",
            "scare",
            "scatter",
            "scene",
            "scheme",
            "school",
            "science",
            "scissors",
            "scorpion",
            "scout",
            "scrap",
            "screen",
            "script",
            "scrub",
            "sea",
            "search",
            "season",
            "seat",
            "second",
            "secret",
            "section",
            "security",
            "seed",
            "seek",
            "segment",
            "select",
            "sell",
            "seminar",
            "senior",
            "sense",
            "sentence",
            "series",
            "service",
            "session",
            "settle",
            "setup",
            "seven",
            "shadow",
            "shaft",
            "shallow",
            "share",
            "shed",
            "shell",
            "sheriff",
            "shield",
            "shift",
            "shine",
            "ship",
            "shiver",
            "shock",
            "shoe",
            "shoot",
            "shop",
            "short",
            "shoulder",
            "shove",
            "shrimp",
            "shrug",
            "shuffle",
            "shy",
            "sibling",
            "sick",
            "side",
            "siege",
            "sight",
            "sign",
            "silent",
            "silk",
            "silly",
            "silver",
            "similar",
            "simple",
            "since",
            "sing",
            "siren",
            "sister",
            "situate",
            "six",
            "size",
            "skate",
            "sketch",
            "ski",
            "skill",
            "skin",
            "skirt",
            "skull",
            "slab",
            "slam",
            "sleep",
            "slender",
            "slice",
            "slide",
            "slight",
            "slim",
            "slogan",
            "slot",
            "slow",
            "slush",
            "small",
            "smart",
            "smile",
            "smoke",
            "smooth",
            "snack",
            "snake",
            "snap",
            "sniff",
            "snow",
            "soap",
            "soccer",
            "social",
            "sock",
            "soda",
            "soft",
            "solar",
            "soldier",
            "solid",
            "solution",
            "solve",
            "someone",
            "song",
            "soon",
            "sorry",
            "sort",
            "soul",
            "sound",
            "soup",
            "source",
            "south",
            "space",
            "spare",
            "spatial",
            "spawn",
            "speak",
            "special",
            "speed",
            "spell",
            "spend",
            "sphere",
            "spice",
            "spider",
            "spike",
            "spin",
            "spirit",
            "split",
            "spoil",
            "sponsor",
            "spoon",
            "sport",
            "spot",
            "spray",
            "spread",
            "spring",
            "spy",
            "square",
            "squeeze",
            "squirrel",
            "stable",
            "stadium",
            "staff",
            "stage",
            "stairs",
            "stamp",
            "stand",
            "start",
            "state",
            "stay",
            "steak",
            "steel",
            "stem",
            "step",
            "stereo",
            "stick",
            "still",
            "sting",
            "stock",
            "stomach",
            "stone",
            "stool",
            "story",
            "stove",
            "strategy",
            "street",
            "strike",
            "strong",
            "struggle",
            "student",
            "stuff",
            "stumble",
            "style",
            "subject",
            "submit",
            "subway",
            "success",
            "such",
            "sudden",
            "suffer",
            "sugar",
            "suggest",
            "suit",
            "summer",
            "sun",
            "sunny",
            "sunset",
            "super",
            "supply",
            "supreme",
            "sure",
            "surface",
            "surge",
            "surprise",
            "surround",
            "survey",
            "suspect",
            "sustain",
            "swallow",
            "swamp",
            "swap",
            "swarm",
            "swear",
            "sweet",
            "swift",
            "swim",
            "swing",
            "switch",
            "sword",
            "symbol",
            "symptom",
            "syrup",
            "system",
            "table",
            "tackle",
            "tag",
            "tail",
            "talent",
            "talk",
            "tank",
            "tape",
            "target",
            "task",
            "taste",
            "tattoo",
            "taxi",
            "teach",
            "team",
            "tell",
            "ten",
            "tenant",
            "tennis",
            "tent",
            "term",
            "test",
            "text",
            "thank",
            "that",
            "theme",
            "then",
            "theory",
            "there",
            "they",
            "thing",
            "this",
            "thought",
            "three",
            "thrive",
            "throw",
            "thumb",
            "thunder",
            "ticket",
            "tide",
            "tiger",
            "tilt",
            "timber",
            "time",
            "tiny",
            "tip",
            "tired",
            "tissue",
            "title",
            "toast",
            "tobacco",
            "today",
            "toddler",
            "toe",
            "together",
            "toilet",
            "token",
            "tomato",
            "tomorrow",
            "tone",
            "tongue",
            "tonight",
            "tool",
            "tooth",
            "top",
            "topic",
            "topple",
            "torch",
            "tornado",
            "tortoise",
            "toss",
            "total",
            "tourist",
            "toward",
            "tower",
            "town",
            "toy",
            "track",
            "trade",
            "traffic",
            "tragic",
            "train",
            "transfer",
            "trap",
            "trash",
            "travel",
            "tray",
            "treat",
            "tree",
            "trend",
            "trial",
            "tribe",
            "trick",
            "trigger",
            "trim",
            "trip",
            "trophy",
            "trouble",
            "truck",
            "true",
            "truly",
            "trumpet",
            "trust",
            "truth",
            "try",
            "tube",
            "tuition",
            "tumble",
            "tuna",
            "tunnel",
       
Download .txt
gitextract_ei6psuhp/

├── .gitignore
├── LICENSE
├── README.md
├── build.gradle
├── gradle/
│   └── wrapper/
│       ├── gradle-wrapper.jar
│       └── gradle-wrapper.properties
├── gradle.properties
├── gradlew
├── gradlew.bat
├── library/
│   ├── .gitignore
│   ├── build.gradle
│   ├── proguard-rules.pro
│   └── src/
│       ├── androidTest/
│       │   └── java/
│       │       └── com/
│       │           └── quincysx/
│       │               └── crypto/
│       │                   └── ExampleInstrumentedTest.java
│       ├── main/
│       │   ├── AndroidManifest.xml
│       │   ├── java/
│       │   │   └── com/
│       │   │       └── quincysx/
│       │   │           └── crypto/
│       │   │               ├── CoinTypes.java
│       │   │               ├── ECKeyPair.java
│       │   │               ├── ECPublicKey.java
│       │   │               ├── Key.java
│       │   │               ├── SecureCharSequence.java
│       │   │               ├── Transaction.java
│       │   │               ├── TrulySecureRandom.java
│       │   │               ├── bip32/
│       │   │               │   ├── ExtendedKey.java
│       │   │               │   ├── Index.java
│       │   │               │   └── ValidationException.java
│       │   │               ├── bip38/
│       │   │               │   ├── Bip38.java
│       │   │               │   └── Rijndael.java
│       │   │               ├── bip39/
│       │   │               │   ├── ByteUtils.java
│       │   │               │   ├── CharSequenceComparators.java
│       │   │               │   ├── CharSequenceSplitter.java
│       │   │               │   ├── MnemonicGenerator.java
│       │   │               │   ├── MnemonicValidator.java
│       │   │               │   ├── NFKDNormalizer.java
│       │   │               │   ├── Normalization.java
│       │   │               │   ├── PBKDF2WithHmacSHA512.java
│       │   │               │   ├── RandomSeed.java
│       │   │               │   ├── SeedCalculator.java
│       │   │               │   ├── SeedCalculatorByWordListLookUp.java
│       │   │               │   ├── SpongyCastlePBKDF2WithHmacSHA512.java
│       │   │               │   ├── WordCount.java
│       │   │               │   ├── WordList.java
│       │   │               │   ├── WordListMapNormalization.java
│       │   │               │   ├── exception/
│       │   │               │   │   └── MnemonicException.java
│       │   │               │   ├── validation/
│       │   │               │   │   ├── InvalidChecksumException.java
│       │   │               │   │   ├── InvalidWordCountException.java
│       │   │               │   │   ├── UnexpectedWhiteSpaceException.java
│       │   │               │   │   └── WordNotFoundException.java
│       │   │               │   └── wordlists/
│       │   │               │       ├── English.java
│       │   │               │       ├── French.java
│       │   │               │       ├── Japanese.java
│       │   │               │       └── Spanish.java
│       │   │               ├── bip44/
│       │   │               │   ├── Account.java
│       │   │               │   ├── AddressIndex.java
│       │   │               │   ├── BIP44.java
│       │   │               │   ├── Change.java
│       │   │               │   ├── CoinPairDerive.java
│       │   │               │   ├── CoinType.java
│       │   │               │   ├── M.java
│       │   │               │   └── Purpose.java
│       │   │               ├── bitcoin/
│       │   │               │   ├── BTCTransaction.java
│       │   │               │   ├── BitCoinECKeyPair.java
│       │   │               │   ├── BitcoinException.java
│       │   │               │   ├── BitcoinInputStream.java
│       │   │               │   └── BitcoinOutputStream.java
│       │   │               ├── eip55/
│       │   │               │   └── EthCheckAddress.java
│       │   │               ├── eos/
│       │   │               │   └── EOSECKeyPair.java
│       │   │               ├── ethereum/
│       │   │               │   ├── Bloom.java
│       │   │               │   ├── ByteArrayWrapper.java
│       │   │               │   ├── CallTransaction.java
│       │   │               │   ├── ECDSASignature.java
│       │   │               │   ├── EthECKeyPair.java
│       │   │               │   ├── EthTransaction.java
│       │   │               │   ├── config/
│       │   │               │   │   └── Constants.java
│       │   │               │   ├── keystore/
│       │   │               │   │   ├── CipherException.java
│       │   │               │   │   ├── KeyStore.java
│       │   │               │   │   └── KeyStoreFile.java
│       │   │               │   ├── rlp/
│       │   │               │   │   ├── CompactEncoder.java
│       │   │               │   │   ├── DecodeResult.java
│       │   │               │   │   ├── RLP.java
│       │   │               │   │   ├── RLPElement.java
│       │   │               │   │   ├── RLPItem.java
│       │   │               │   │   ├── RLPList.java
│       │   │               │   │   └── Value.java
│       │   │               │   ├── solidity/
│       │   │               │   │   └── SolidityType.java
│       │   │               │   ├── utils/
│       │   │               │   │   ├── ByteUtil.java
│       │   │               │   │   └── FastByteComparisons.java
│       │   │               │   └── vm/
│       │   │               │       ├── DataWord.java
│       │   │               │       └── LogInfo.java
│       │   │               ├── exception/
│       │   │               │   ├── CoinNotFindException.java
│       │   │               │   └── NonSupportException.java
│       │   │               └── utils/
│       │   │                   ├── BTCUtils.java
│       │   │                   ├── Base58.java
│       │   │                   ├── Base58Check.java
│       │   │                   ├── Base64.java
│       │   │                   ├── HexUtils.java
│       │   │                   ├── HmacSha512.java
│       │   │                   ├── KECCAK256.java
│       │   │                   ├── RIPEMD160.java
│       │   │                   └── SHA256.java
│       │   └── res/
│       │       └── values/
│       │           └── strings.xml
│       └── test/
│           └── java/
│               └── com/
│                   └── quincysx/
│                       └── crypto/
│                           ├── Bip32UnitTest.java
│                           ├── Bip39UnitTest.java
│                           ├── Bip44UnitTest.java
│                           ├── Eip55UnitTest.java
│                           ├── ExampleUnitTest.java
│                           └── HashUnitTest.java
├── sample/
│   ├── .gitignore
│   ├── build.gradle
│   ├── proguard-rules.pro
│   └── src/
│       ├── androidTest/
│       │   └── java/
│       │       └── com/
│       │           └── quincysx/
│       │               └── crypto/
│       │                   └── ExampleInstrumentedTest.java
│       ├── main/
│       │   ├── AndroidManifest.xml
│       │   ├── java/
│       │   │   └── com/
│       │   │       └── quincysx/
│       │   │           └── crypto/
│       │   │               └── smpale/
│       │   │                   ├── Main1Activity.java
│       │   │                   └── MainActivity.java
│       │   └── res/
│       │       ├── drawable/
│       │       │   └── ic_launcher_background.xml
│       │       ├── drawable-v24/
│       │       │   └── ic_launcher_foreground.xml
│       │       ├── layout/
│       │       │   └── activity_main.xml
│       │       ├── mipmap-anydpi-v26/
│       │       │   ├── ic_launcher.xml
│       │       │   └── ic_launcher_round.xml
│       │       └── values/
│       │           ├── colors.xml
│       │           ├── strings.xml
│       │           └── styles.xml
│       └── test/
│           └── java/
│               └── com/
│                   └── quincysx/
│                       └── crypto/
│                           └── ExampleUnitTest.java
└── settings.gradle
Download .txt
SYMBOL INDEX (953 symbols across 95 files)

FILE: library/src/androidTest/java/com/quincysx/crypto/ExampleInstrumentedTest.java
  class ExampleInstrumentedTest (line 17) | @RunWith(AndroidJUnit4.class)
    method useAppContext (line 19) | @Test

FILE: library/src/main/java/com/quincysx/crypto/CoinTypes.java
  type CoinTypes (line 9) | public enum CoinTypes {
    method CoinTypes (line 20) | CoinTypes(int i, String name) {
    method coinType (line 25) | public int coinType() {
    method coinName (line 29) | public String coinName() {
    method parseCoinType (line 33) | public static CoinTypes parseCoinType(int type) throws CoinNotFindExce...

FILE: library/src/main/java/com/quincysx/crypto/ECKeyPair.java
  class ECKeyPair (line 41) | public class ECKeyPair implements Key {
    method ECKeyPair (line 54) | protected ECKeyPair() {
    method ECKeyPair (line 57) | public ECKeyPair(byte[] p, boolean compressed) throws ValidationExcept...
    method ECKeyPair (line 64) | public ECKeyPair(BigInteger priv, boolean compressed) {
    method ECKeyPair (line 73) | protected ECKeyPair(Key keyPair) {
    method isCompressed (line 80) | @Override
    method clone (line 85) | @Override
    method createNew (line 95) | public static ECKeyPair createNew(boolean compressed) {
    method setPublic (line 112) | public void setPublic(byte[] pub) throws ValidationException {
    method getRawPrivateKey (line 116) | @Override
    method getRawPublicKey (line 129) | @Override
    method getRawPublicKey (line 138) | @Override
    method getRawAddress (line 143) | @Override
    method getPrivateKey (line 148) | @Override
    method getPublicKey (line 153) | @Override
    method getAddress (line 158) | @Override
    method sign (line 163) | @Override
    method verify (line 168) | public static boolean verify(byte[] hash, byte[] signature, byte[] pub) {

FILE: library/src/main/java/com/quincysx/crypto/ECPublicKey.java
  class ECPublicKey (line 23) | public class ECPublicKey implements Key {
    method ECPublicKey (line 27) | public ECPublicKey(byte[] pub, boolean compressed) {
    method isCompressed (line 32) | @Override
    method setCompressed (line 37) | public void setCompressed(boolean compressed) {
    method getRawPrivateKey (line 41) | @Override
    method getRawPublicKey (line 46) | @Override
    method getRawPublicKey (line 54) | @Override
    method getRawAddress (line 59) | @Override
    method getPrivateKey (line 64) | @Override
    method getPublicKey (line 69) | @Override
    method getAddress (line 74) | @Override
    method clone (line 79) | @Override
    method sign (line 86) | @Override

FILE: library/src/main/java/com/quincysx/crypto/Key.java
  type Key (line 21) | public interface Key extends Cloneable {
    method getRawPrivateKey (line 27) | public byte[] getRawPrivateKey();
    method getRawPublicKey (line 35) | public byte[] getRawPublicKey(boolean isCompressed);
    method getRawPublicKey (line 42) | public byte[] getRawPublicKey();
    method getRawAddress (line 49) | public byte[] getRawAddress();
    method getPrivateKey (line 56) | public String getPrivateKey();
    method getPublicKey (line 63) | public String getPublicKey();
    method getAddress (line 70) | public String getAddress();
    method isCompressed (line 77) | public boolean isCompressed();
    method clone (line 79) | public Key clone() throws CloneNotSupportedException;
    method sign (line 81) | public <T extends Object> T sign(byte[] messageHash) throws Validation...

FILE: library/src/main/java/com/quincysx/crypto/SecureCharSequence.java
  class SecureCharSequence (line 10) | public class SecureCharSequence implements CharSequence {
    method SecureCharSequence (line 13) | public SecureCharSequence(CharSequence charSequence) {
    method SecureCharSequence (line 17) | public SecureCharSequence(char[] chars) {
    method SecureCharSequence (line 22) | private SecureCharSequence(CharSequence charSequence, int start, int e...
    method wipe (line 34) | public void wipe() {
    method finalize (line 49) | protected void finalize() {
    method length (line 53) | @Override
    method charAt (line 61) | @Override
    method toString (line 69) | @Override
    method equals (line 74) | @Override
    method subSequence (line 82) | @Override

FILE: library/src/main/java/com/quincysx/crypto/Transaction.java
  type Transaction (line 9) | public interface Transaction {
    method sign (line 10) | byte[] sign(ECKeyPair key) throws ValidationException;
    method getSignBytes (line 12) | public byte[] getSignBytes();
    method getData (line 19) | public byte[] getData();

FILE: library/src/main/java/com/quincysx/crypto/TrulySecureRandom.java
  class TrulySecureRandom (line 45) | public class TrulySecureRandom extends java.security.SecureRandom {
    method TrulySecureRandom (line 51) | public TrulySecureRandom() {
    method addSeedMaterial (line 55) | public void addSeedMaterial(long seed) {
    method addSeedMaterial (line 59) | private void addSeedMaterial(byte[] seed) {
    method nextInt (line 63) | @Override
    method nextInt (line 70) | @Override
    method nextBytes (line 75) | @Override
    method getAlgorithm (line 123) | @Override
    method getDevRandomSeed (line 128) | private byte[] getDevRandomSeed() {
    method setSeed (line 155) | @Override
    method setSeed (line 160) | @Override
    method generateSeed (line 165) | @Override
    method nextBoolean (line 170) | @Override
    method nextDouble (line 175) | @Override
    method nextFloat (line 180) | @Override
    method nextGaussian (line 185) | @Override
    method nextLong (line 190) | @Override

FILE: library/src/main/java/com/quincysx/crypto/bip32/ExtendedKey.java
  class ExtendedKey (line 51) | public class ExtendedKey {
    method createFromPassphrase (line 63) | public static ExtendedKey createFromPassphrase(String passphrase, byte...
    method encrypt (line 101) | public byte[] encrypt(String passphrase, boolean production) throws Va...
    method create (line 121) | public static ExtendedKey create(byte[] seed) throws ValidationExcepti...
    method createNew (line 144) | public static ExtendedKey createNew() {
    method parsePrivateKey (line 157) | public static ExtendedKey parsePrivateKey(byte[] bytes) throws Validat...
    method ExtendedKey (line 164) | public ExtendedKey(Key key, byte[] chainCode, int depth, int parent, i...
    method getMaster (line 172) | public Key getMaster() {
    method getChainCode (line 176) | public byte[] getChainCode() {
    method getDepth (line 180) | public int getDepth() {
    method getParent (line 184) | public int getParent() {
    method getSequence (line 188) | public int getSequence() {
    method getFingerPrint (line 192) | public int getFingerPrint() {
    method getKey (line 202) | public Key getKey(int sequence) throws ValidationException {
    method getChild (line 206) | public ExtendedKey getChild(int sequence) throws ValidationException {
    method getReadOnly (line 212) | public ExtendedKey getReadOnly() {
    method isReadOnly (line 217) | public boolean isReadOnly() {
    method generateKey (line 221) | private ExtendedKey generateKey(int sequence) throws ValidationExcepti...
    method serialize (line 287) | public String serialize(boolean production) {
    method parse (line 324) | public static ExtendedKey parse(String serialized) throws ValidationEx...

FILE: library/src/main/java/com/quincysx/crypto/bip32/Index.java
  class Index (line 7) | public final class Index {
    method Index (line 8) | Index() {
    method hard (line 11) | public static int hard(final int index) {
    method isHardened (line 15) | public static boolean isHardened(final int i) {

FILE: library/src/main/java/com/quincysx/crypto/bip32/ValidationException.java
  class ValidationException (line 18) | public class ValidationException extends Exception
    method ValidationException (line 22) | public ValidationException(Throwable cause)
    method ValidationException (line 27) | public ValidationException(String message, Throwable cause)
    method ValidationException (line 32) | public ValidationException(String message)

FILE: library/src/main/java/com/quincysx/crypto/bip38/Bip38.java
  class Bip38 (line 22) | public class Bip38 {
    method encryptNoEcMultiply (line 45) | public static String encryptNoEcMultiply(CharSequence passphrase, Stri...
    method bip38Stretch1 (line 83) | public static byte[] bip38Stretch1(CharSequence passphrase, byte[] sal...
    method convertToByteArray (line 100) | private static byte[] convertToByteArray(CharSequence charSequence) {
    method encryptNoEcMultiply (line 114) | public static String encryptNoEcMultiply(byte[] stretcedKeyMaterial, B...
    method isBip38PrivateKey (line 174) | public static boolean isBip38PrivateKey(String bip38PrivateKey) {
    class Bip38PrivateKey (line 178) | public static class Bip38PrivateKey {
      method Bip38PrivateKey (line 185) | public Bip38PrivateKey(boolean ecMultiply, boolean compressed, boole...
    method parseBip38PrivateKey (line 194) | public static Bip38PrivateKey parseBip38PrivateKey(String bip38Private...
    method decrypt (line 265) | public static BitCoinECKeyPair decrypt(String bip38PrivateKeyString, C...
    method decryptEcMultiply (line 278) | public static BitCoinECKeyPair decryptEcMultiply(Bip38PrivateKey bip38...
    method decryptNoEcMultiply (line 367) | public static BitCoinECKeyPair decryptNoEcMultiply(Bip38PrivateKey bip...
    method verify (line 405) | private static BitCoinECKeyPair verify(byte[] complete, byte[] salt, b...
    method calculateScryptSalt (line 417) | public static byte[] calculateScryptSalt(String address) {
    method xorBytes (line 424) | private static void xorBytes(byte[] toApply, byte[] target) {

FILE: library/src/main/java/com/quincysx/crypto/bip38/Rijndael.java
  class Rijndael (line 7) | public final class Rijndael {
    method Rijndael (line 9) | public Rijndael() {
    method expandKey (line 172) | private void expandKey(byte[] cipherKey) {
    method invertKey (line 323) | private void invertKey() {
    method makeKey (line 376) | public void makeKey(byte[] cipherKey, int keyBits, int direction)
    method makeKey (line 411) | public void makeKey(byte[] cipherKey, int keyBits)
    method encrypt (line 422) | public void encrypt(byte[] pt, byte[] ct) {
    method decrypt (line 514) | public void decrypt(byte[] ct, byte[] pt) {
    method finalize (line 603) | protected final void finalize() {

FILE: library/src/main/java/com/quincysx/crypto/bip39/ByteUtils.java
  class ByteUtils (line 7) | final class ByteUtils {
    method next11Bits (line 8) | static int next11Bits(byte[] bytes, int offset) {
    method writeNext11 (line 18) | static void writeNext11(byte[] bytes, int value, int offset) {

FILE: library/src/main/java/com/quincysx/crypto/bip39/CharSequenceComparators.java
  type CharSequenceComparators (line 9) | enum CharSequenceComparators implements Comparator<CharSequence> {
    method compare (line 12) | @Override

FILE: library/src/main/java/com/quincysx/crypto/bip39/CharSequenceSplitter.java
  class CharSequenceSplitter (line 10) | final class CharSequenceSplitter {
    method CharSequenceSplitter (line 14) | CharSequenceSplitter(final char separator1, final char separator2) {
    method split (line 19) | List<CharSequence> split(final CharSequence charSequence) {

FILE: library/src/main/java/com/quincysx/crypto/bip39/MnemonicGenerator.java
  class MnemonicGenerator (line 13) | public final class MnemonicGenerator {
    method MnemonicGenerator (line 21) | public MnemonicGenerator(final WordList wordList) {
    method createMnemonic (line 25) | public List<String> createMnemonic(
    method createMnemonic (line 41) | public List<String> createMnemonic(
    method createMnemonic (line 51) | private List<String> createMnemonic(
    method wordIndexes (line 61) | private static int[] wordIndexes(byte[] entropy) {
    method firstByteOfSha256 (line 81) | static byte firstByteOfSha256(final byte[] entropy) {
    method entropyLengthPreChecks (line 88) | private static void entropyLengthPreChecks(final int ent) {
    method parseHex (line 97) | private static int parseHex(char c) {

FILE: library/src/main/java/com/quincysx/crypto/bip39/MnemonicValidator.java
  class MnemonicValidator (line 16) | public final class MnemonicValidator {
    method MnemonicValidator (line 21) | private MnemonicValidator(final WordList wordList) {
    method ofWordList (line 38) | public static MnemonicValidator ofWordList(final WordList wordList) {
    method validate (line 51) | public void validate(final CharSequence mnemonic) throws
    method validate (line 71) | public void validate(final Collection<? extends CharSequence> mnemonic...
    method validate (line 84) | private static void validate(final int[] wordIndexes) throws
    method findWordIndexes (line 111) | private int[] findWordIndexes(final Collection<? extends CharSequence>...
    method findWordIndex (line 126) | private int findWordIndex(final CharSequence buffer) throws WordNotFou...
    method wordIndexesToEntropyWithCheckSum (line 139) | private static void wordIndexesToEntropyWithCheckSum(final int[] wordI...
    method maskOfFirstNBits (line 145) | private static byte maskOfFirstNBits(final int n) {
    method compare (line 150) | @Override
    class WordAndIndex (line 156) | private class WordAndIndex {
      method WordAndIndex (line 161) | WordAndIndex(final int i, final CharSequence word) {

FILE: library/src/main/java/com/quincysx/crypto/bip39/NFKDNormalizer.java
  type NFKDNormalizer (line 7) | public interface NFKDNormalizer {
    method normalize (line 8) | String normalize(CharSequence charSequence);

FILE: library/src/main/java/com/quincysx/crypto/bip39/Normalization.java
  class Normalization (line 9) | final class Normalization {
    method normalizeNFKD (line 10) | static String normalizeNFKD(final String string) {
    method normalizeNFKD (line 14) | static char normalizeNFKD(final char c) {

FILE: library/src/main/java/com/quincysx/crypto/bip39/PBKDF2WithHmacSHA512.java
  type PBKDF2WithHmacSHA512 (line 7) | public interface PBKDF2WithHmacSHA512 {
    method hash (line 8) | byte[] hash(final char[] chars, final byte[] salt);

FILE: library/src/main/java/com/quincysx/crypto/bip39/RandomSeed.java
  class RandomSeed (line 10) | public class RandomSeed {
    method random (line 11) | public static byte[] random(WordCount words) {
    method random (line 15) | public static byte[] random(WordCount words, Random random) {

FILE: library/src/main/java/com/quincysx/crypto/bip39/SeedCalculator.java
  class SeedCalculator (line 17) | public final class SeedCalculator {
    method SeedCalculator (line 21) | public SeedCalculator(final PBKDF2WithHmacSHA512 hashAlgorithm) {
    method SeedCalculator (line 29) | public SeedCalculator() {
    method calculateSeed (line 33) | public byte[] calculateSeed(final List<String> mnemonicList, final Str...
    method calculateSeed (line 59) | public byte[] calculateSeed(final String mnemonic, final String passph...
    method calculateSeed (line 68) | byte[] calculateSeed(final char[] mnemonicChars, final String passphra...
    method withWordsFromWordList (line 78) | public SeedCalculatorByWordListLookUp withWordsFromWordList(final Word...
    method combine (line 82) | private static byte[] combine(final byte[] array1, final byte[] array2) {
    method clear (line 89) | private static void clear(final byte[] salt) {
    method hash (line 93) | private byte[] hash(final char[] chars, final byte[] salt) {
    method getUtf8Bytes (line 97) | private static byte[] getUtf8Bytes(final String string) {

FILE: library/src/main/java/com/quincysx/crypto/bip39/SeedCalculatorByWordListLookUp.java
  class SeedCalculatorByWordListLookUp (line 14) | public final class SeedCalculatorByWordListLookUp {
    method SeedCalculatorByWordListLookUp (line 19) | SeedCalculatorByWordListLookUp(final SeedCalculator seedCalculator, fi...
    method calculateSeed (line 43) | public byte[] calculateSeed(final Collection<? extends CharSequence> m...

FILE: library/src/main/java/com/quincysx/crypto/bip39/SpongyCastlePBKDF2WithHmacSHA512.java
  type SpongyCastlePBKDF2WithHmacSHA512 (line 12) | public enum SpongyCastlePBKDF2WithHmacSHA512 implements PBKDF2WithHmacSH...
    method hash (line 15) | @Override

FILE: library/src/main/java/com/quincysx/crypto/bip39/WordCount.java
  type WordCount (line 8) | public enum WordCount {
    method WordCount (line 44) | WordCount(int bitLength) {
    method bitLength (line 48) | public int bitLength() {
    method byteLength (line 52) | public int byteLength() {

FILE: library/src/main/java/com/quincysx/crypto/bip39/WordList.java
  type WordList (line 24) | public interface WordList {
    method getWord (line 32) | String getWord(final int index);
    method getIndex (line 34) | int getIndex(final String word);
    method getSpace (line 41) | char getSpace();

FILE: library/src/main/java/com/quincysx/crypto/bip39/WordListMapNormalization.java
  class WordListMapNormalization (line 11) | public class WordListMapNormalization implements NFKDNormalizer {
    method WordListMapNormalization (line 14) | WordListMapNormalization(final WordList wordList) {
    method normalize (line 24) | @Override

FILE: library/src/main/java/com/quincysx/crypto/bip39/exception/MnemonicException.java
  class MnemonicException (line 24) | @SuppressWarnings("serial")
    method MnemonicException (line 26) | public MnemonicException() {
    method MnemonicException (line 30) | public MnemonicException(String msg) {
    class MnemonicLengthException (line 37) | public static class MnemonicLengthException extends MnemonicException {
      method MnemonicLengthException (line 38) | public MnemonicLengthException(String msg) {
    class MnemonicChecksumException (line 46) | public static class MnemonicChecksumException extends MnemonicException {
      method MnemonicChecksumException (line 47) | public MnemonicChecksumException() {
    class MnemonicWordException (line 55) | public static class MnemonicWordException extends MnemonicException {
      method MnemonicWordException (line 61) | public MnemonicWordException(String badWord) {

FILE: library/src/main/java/com/quincysx/crypto/bip39/validation/InvalidChecksumException.java
  class InvalidChecksumException (line 7) | public class InvalidChecksumException extends Exception {
    method InvalidChecksumException (line 8) | public InvalidChecksumException() {

FILE: library/src/main/java/com/quincysx/crypto/bip39/validation/InvalidWordCountException.java
  class InvalidWordCountException (line 7) | public class InvalidWordCountException extends Exception {
    method InvalidWordCountException (line 8) | public InvalidWordCountException() {

FILE: library/src/main/java/com/quincysx/crypto/bip39/validation/UnexpectedWhiteSpaceException.java
  class UnexpectedWhiteSpaceException (line 7) | public class UnexpectedWhiteSpaceException extends Exception {
    method UnexpectedWhiteSpaceException (line 8) | public UnexpectedWhiteSpaceException() {

FILE: library/src/main/java/com/quincysx/crypto/bip39/validation/WordNotFoundException.java
  class WordNotFoundException (line 7) | public class WordNotFoundException extends Exception {
    method WordNotFoundException (line 12) | public WordNotFoundException(
    method getWord (line 26) | public CharSequence getWord() {
    method getSuggestion1 (line 30) | public CharSequence getSuggestion1() {
    method getSuggestion2 (line 34) | public CharSequence getSuggestion2() {

FILE: library/src/main/java/com/quincysx/crypto/bip39/wordlists/English.java
  type English (line 30) | public enum English implements WordList {
    method getWord (line 33) | @Override
    method getIndex (line 38) | @Override
    method getSpace (line 53) | @Override

FILE: library/src/main/java/com/quincysx/crypto/bip39/wordlists/French.java
  type French (line 29) | public enum French implements WordList {
    method getWord (line 32) | @Override
    method getIndex (line 37) | @Override
    method getSpace (line 52) | @Override

FILE: library/src/main/java/com/quincysx/crypto/bip39/wordlists/Japanese.java
  type Japanese (line 30) | public enum Japanese implements WordList {
    method getWord (line 33) | @Override
    method getIndex (line 38) | @Override
    method getSpace (line 53) | @Override

FILE: library/src/main/java/com/quincysx/crypto/bip39/wordlists/Spanish.java
  type Spanish (line 30) | public enum Spanish implements WordList {
    method getWord (line 33) | @Override
    method getIndex (line 38) | @Override
    method getSpace (line 53) | @Override

FILE: library/src/main/java/com/quincysx/crypto/bip44/Account.java
  class Account (line 9) | public class Account {
    method Account (line 14) | Account(final CoinType coinType, final int account) {
    method getValue (line 22) | public int getValue() {
    method getParent (line 26) | public CoinType getParent() {
    method toString (line 30) | @Override
    method external (line 44) | public Change external() {
    method internal (line 57) | public Change internal() {

FILE: library/src/main/java/com/quincysx/crypto/bip44/AddressIndex.java
  class AddressIndex (line 9) | public class AddressIndex {
    method AddressIndex (line 16) | AddressIndex(final Change change, final int addressIndex) {
    method AddressIndex (line 20) | AddressIndex(final Change change, final int addressIndex, final boolea...
    method getValue (line 31) | public int getValue() {
    method getParent (line 38) | public Change getParent() {
    method toString (line 42) | @Override

FILE: library/src/main/java/com/quincysx/crypto/bip44/BIP44.java
  class BIP44 (line 16) | public final class BIP44 {
    method BIP44 (line 20) | BIP44() {
    method m (line 28) | public static M m() {
    method parsePath (line 32) | public static AddressIndex parsePath(String path) throws NonSupportExc...

FILE: library/src/main/java/com/quincysx/crypto/bip44/Change.java
  class Change (line 7) | public class Change {
    method Change (line 12) | Change(final Account account, final int change) {
    method getValue (line 18) | public int getValue() {
    method getParent (line 22) | public Account getParent() {
    method toString (line 26) | @Override
    method address (line 37) | public AddressIndex address(final int addressIndex) {
    method address (line 41) | public AddressIndex address(final int addressIndex, final boolean hard) {

FILE: library/src/main/java/com/quincysx/crypto/bip44/CoinPairDerive.java
  class CoinPairDerive (line 26) | public class CoinPairDerive {
    method CoinPairDerive (line 29) | public CoinPairDerive(ExtendedKey extendedKey) {
    method deriveByExtendedKey (line 33) | public ExtendedKey deriveByExtendedKey(AddressIndex addressIndex) thro...
    method derive (line 49) | public ECKeyPair derive(AddressIndex addressIndex) throws ValidationEx...
    method convertKeyPair (line 56) | public ECKeyPair convertKeyPair(ExtendedKey child, CoinTypes coinType)...

FILE: library/src/main/java/com/quincysx/crypto/bip44/CoinType.java
  class CoinType (line 10) | public class CoinType {
    method CoinType (line 15) | CoinType(final Purpose purpose, final CoinTypes coinType) {
    method getValue (line 21) | public CoinTypes getValue() {
    method getParent (line 25) | public Purpose getParent() {
    method toString (line 29) | @Override
    method account (line 40) | public Account account(final int account) {

FILE: library/src/main/java/com/quincysx/crypto/bip44/M.java
  class M (line 7) | public final class M {
    method M (line 11) | M() {
    method purpose (line 21) | public Purpose purpose(final int purpose) {
    method purpose44 (line 32) | public Purpose purpose44() {
    method purpose49 (line 36) | public Purpose purpose49() {
    method toString (line 40) | @Override

FILE: library/src/main/java/com/quincysx/crypto/bip44/Purpose.java
  class Purpose (line 10) | public final class Purpose {
    method Purpose (line 15) | Purpose(final M m, final int purpose) {
    method getValue (line 23) | public int getValue() {
    method toString (line 27) | @Override
    method coinType (line 38) | public CoinType coinType(final CoinTypes coinType) {

FILE: library/src/main/java/com/quincysx/crypto/bitcoin/BTCTransaction.java
  class BTCTransaction (line 43) | @SuppressWarnings("WeakerAccess")
    method BTCTransaction (line 50) | public BTCTransaction(byte[] rawBytes) throws BitcoinException {
    method BTCTransaction (line 102) | public BTCTransaction(Input[] inputs, Output[] outputs, int lockTime) {
    method getSignBytes (line 109) | @Override
    method getBytes (line 114) | public byte[] getBytes() {
    method getData (line 151) | @Override
    method toString (line 156) | @Override
    method printAsJsonArray (line 165) | private String printAsJsonArray(Object[] a) {
    class Input (line 183) | public static class Input {
      method Input (line 188) | public Input(OutPoint outPoint, Script script, int sequence) {
      method toString (line 194) | @Override
    class OutPoint (line 201) | public static class OutPoint {
      method OutPoint (line 207) | public OutPoint(byte[] hash, int index) {
      method toString (line 212) | @Override
    class Output (line 218) | public static class Output {
      method Output (line 222) | public Output(long value, Script script) {
      method toString (line 227) | @Override
    class Script (line 233) | public static final class Script {
      class ScriptInvalidException (line 235) | public static class ScriptInvalidException extends Exception {
        method ScriptInvalidException (line 236) | public ScriptInvalidException() {
        method ScriptInvalidException (line 239) | public ScriptInvalidException(String s) {
      method Script (line 272) | public Script(byte[] rawBytes) {
      method Script (line 276) | public Script(byte[] data1, byte[] data2) {
      method writeBytes (line 288) | private static void writeBytes(byte[] data, ByteArrayOutputStream ba...
      method run (line 312) | public void run(Stack<byte[]> stack) throws ScriptInvalidException {
      method run (line 316) | public void run(int inputIndex, BTCTransaction tx, Stack<byte[]> sta...
      method hashTransaction (line 413) | public static byte[] hashTransaction(int inputIndex, byte[] subscrip...
      method hashTransactionForSigning (line 430) | public static byte[] hashTransactionForSigning(BTCTransaction unsign...
      method verifyFails (line 443) | public static boolean verifyFails(Stack<byte[]> stack) {
      method toString (line 459) | @Override
      method convertReadableStringToBytes (line 466) | public static byte[] convertReadableStringToBytes(String readableStr...
      method convertBytesToReadableString (line 546) | public static String convertBytesToReadableString(byte[] bytes) {
      method equals (line 612) | @Override
      method hashCode (line 618) | @Override
      method buildOutput (line 623) | public static Script buildOutput(String address) throws BitcoinExcep...
    method sign (line 675) | @Override

FILE: library/src/main/java/com/quincysx/crypto/bitcoin/BitCoinECKeyPair.java
  class BitCoinECKeyPair (line 30) | public class BitCoinECKeyPair extends ECKeyPair {
    method parse (line 43) | public static BitCoinECKeyPair parse(Key keyPair, boolean testNet) {
    method parseWIF (line 47) | public static BitCoinECKeyPair parseWIF(String wif) throws ValidationE...
    method BitCoinECKeyPair (line 76) | public BitCoinECKeyPair(byte[] p, boolean testNet, boolean compressed)...
    method BitCoinECKeyPair (line 82) | public BitCoinECKeyPair(BigInteger priv, boolean testNet, boolean comp...
    method BitCoinECKeyPair (line 87) | public BitCoinECKeyPair(Key keyPair, boolean testNet) {
    method BitCoinECKeyPair (line 92) | protected BitCoinECKeyPair(BigInteger priv, boolean compressed) throws...
    method isTestNet (line 97) | public boolean isTestNet() {
    method getPrivateKey (line 101) | @Override
    method getPublicKey (line 119) | @Override
    method getAddress (line 124) | @Override
    method getRawPublicKey (line 129) | @Override
    method getRawAddress (line 134) | @Override
    method sign (line 159) | @Override
    method signBTC (line 170) | public byte[] signBTC(byte[] hash) {
    method verifyBTC (line 186) | public boolean verifyBTC(byte[] hash, byte[] signature) {
    method checkChecksum (line 190) | private static void checkChecksum(byte[] store) throws ValidationExcep...
    method signTransaction (line 203) | public static BTCTransaction signTransaction(BTCTransaction transactio...
    method sign (line 220) | public static BTCTransaction.Input sign(BTCTransaction transaction, in...
    method signatureForm (line 248) | private static BTCTransaction signatureForm(BTCTransaction transaction...
    method mkPubKeyScript (line 270) | private static String mkPubKeyScript(String address) {
    method sign (line 289) | public static byte[] sign(BigInteger privateKey, byte[] input) {

FILE: library/src/main/java/com/quincysx/crypto/bitcoin/BitcoinException.java
  class BitcoinException (line 25) | @SuppressWarnings("WeakerAccess")
    method BitcoinException (line 44) | public BitcoinException(int errorCode, String detailMessage, Object ex...
    method BitcoinException (line 50) | public BitcoinException(int errorCode, String detailMessage) {

FILE: library/src/main/java/com/quincysx/crypto/bitcoin/BitcoinInputStream.java
  class BitcoinInputStream (line 29) | @SuppressWarnings("WeakerAccess")
    method BitcoinInputStream (line 31) | public BitcoinInputStream(byte[] buf) {
    method BitcoinInputStream (line 35) | @SuppressWarnings("unused")
    method readInt16 (line 40) | public int readInt16() throws EOFException {
    method readInt32 (line 44) | public int readInt32() throws EOFException {
    method readInt64 (line 48) | public long readInt64() throws EOFException {
    method readByte (line 52) | public int readByte() throws EOFException {
    method readVarInt (line 60) | public long readVarInt() throws EOFException {
    method readChars (line 73) | public byte[] readChars(final int count) throws IOException {

FILE: library/src/main/java/com/quincysx/crypto/bitcoin/BitcoinOutputStream.java
  class BitcoinOutputStream (line 28) | @SuppressWarnings("WeakerAccess")
    method writeInt16 (line 31) | public void writeInt16(int value) {
    method writeInt32 (line 36) | public void writeInt32(int value) {
    method writeInt64 (line 43) | public void writeInt64(long value) {
    method writeVarInt (line 48) | public void writeVarInt(long value) {

FILE: library/src/main/java/com/quincysx/crypto/eip55/EthCheckAddress.java
  class EthCheckAddress (line 10) | public class EthCheckAddress {
    method toChecksumAddress (line 17) | public static String toChecksumAddress(String address) {
    method checksumAddress (line 44) | public static boolean checksumAddress(String address) {
    method checkUppercase (line 65) | private static boolean checkUppercase(String address) {
    method cleanHexPrefix (line 81) | public static String cleanHexPrefix(String input) {
    method containsHexPrefix (line 95) | public static boolean containsHexPrefix(String input) {
    method isEmpty (line 100) | private static boolean isEmpty(String s) {

FILE: library/src/main/java/com/quincysx/crypto/eos/EOSECKeyPair.java
  class EOSECKeyPair (line 19) | public class EOSECKeyPair extends ECKeyPair {
    method parse (line 23) | public static EOSECKeyPair parse(Key keyPair) {
    method parse (line 27) | public static EOSECKeyPair parse(String privateKey) throws ValidationE...
    method EOSECKeyPair (line 45) | public EOSECKeyPair(byte[] p) throws ValidationException {
    method EOSECKeyPair (line 49) | public EOSECKeyPair(BigInteger priv) {
    method EOSECKeyPair (line 53) | public EOSECKeyPair(Key keyPair) {
    method getRawPrivateKey (line 57) | @Override
    method getPrivateKey (line 62) | @Override
    method getRawPublicKey (line 78) | @Override
    method getPublicKey (line 85) | @Override
    method getRawAddress (line 103) | @Override
    method getAddress (line 111) | @Override

FILE: library/src/main/java/com/quincysx/crypto/ethereum/Bloom.java
  class Bloom (line 33) | public class Bloom {
    method Bloom (line 42) | public Bloom() {
    method Bloom (line 45) | public Bloom(byte[] data) {
    method create (line 49) | public static Bloom create(byte[] toBloom) {
    method or (line 65) | public void or(Bloom bloom) {
    method matches (line 71) | public boolean matches(Bloom topicBloom) {
    method getData (line 77) | public byte[] getData() {
    method copy (line 81) | public Bloom copy() {
    method toString (line 85) | @Override
    method equals (line 90) | @Override
    method hashCode (line 101) | @Override

FILE: library/src/main/java/com/quincysx/crypto/ethereum/ByteArrayWrapper.java
  class ByteArrayWrapper (line 31) | public class ByteArrayWrapper implements Comparable<ByteArrayWrapper>, S...
    method ByteArrayWrapper (line 36) | public ByteArrayWrapper(byte[] data) {
    method equals (line 43) | public boolean equals(Object other) {
    method hashCode (line 52) | @Override
    method compareTo (line 57) | @Override
    method getData (line 64) | public byte[] getData() {
    method toString (line 68) | @Override

FILE: library/src/main/java/com/quincysx/crypto/ethereum/CallTransaction.java
  class CallTransaction (line 52) | public class CallTransaction {
    method createRawTransaction (line 58) | public static EthTransaction createRawTransaction(BigInteger nonce, Bi...
    method createCallTransaction (line 83) | public static EthTransaction createCallTransaction(BigInteger nonce, B...
    class Param (line 89) | @JsonInclude(JsonInclude.Include.NON_NULL)
      method getType (line 95) | @JsonGetter("type")
    type FunctionType (line 101) | public enum FunctionType {
    class Function (line 108) | public static class Function {
      method Function (line 117) | private Function() {
      method encode (line 120) | public byte[] encode(Object... args) {
      method encodeArguments (line 124) | public byte[] encodeArguments(Object... args) {
      method decode (line 157) | private Object[] decode(byte[] encoded, Param[] params) {
      method decode (line 172) | public Object[] decode(byte[] encoded) {
      method decodeResult (line 178) | public Object[] decodeResult(byte[] encodedRet) {
      method formatSignature (line 182) | public String formatSignature() {
      method stripEnd (line 192) | public static String stripEnd(final String str, final String stripCh...
      method encodeSignatureLong (line 213) | public byte[] encodeSignatureLong() {
      method encodeSignature (line 220) | public byte[] encodeSignature() {
      method toString (line 224) | @Override
      method fromJsonInterface (line 229) | public static Function fromJsonInterface(String json) {
      method fromSignature (line 237) | public static Function fromSignature(String funcName, String... para...
      method fromSignature (line 241) | public static Function fromSignature(String funcName, String[] param...
    class Contract (line 264) | public static class Contract {
      method Contract (line 265) | public Contract(String jsonInterface) {
      method getByName (line 273) | public Function getByName(String name) {
      method getConstructor (line 282) | public Function getConstructor() {
      method getBySignatureHash (line 291) | private Function getBySignatureHash(byte[] hash) {
      method parseInvocation (line 313) | public Invocation parseInvocation(byte[] data) {
      method parseEvent (line 325) | public Invocation parseEvent(LogInfo eventLog) {
    class Invocation (line 360) | public static class Invocation {
      method Invocation (line 365) | public Invocation(Contract contract, Function function, Object[] arg...
      method toString (line 371) | @Override

FILE: library/src/main/java/com/quincysx/crypto/ethereum/ECDSASignature.java
  class ECDSASignature (line 23) | public class ECDSASignature {
    method ECDSASignature (line 64) | public ECDSASignature(BigInteger r, BigInteger s) {
    method fromComponents (line 76) | private static ECDSASignature fromComponents(byte[] r, byte[] s) {
    method fromComponents (line 86) | public static ECDSASignature fromComponents(byte[] r, byte[] s, byte v) {
    method validateComponents (line 92) | public boolean validateComponents() {
    method validateComponents (line 96) | public static boolean validateComponents(BigInteger r, BigInteger s, b...
    method decodeFromDER (line 109) | public static ECDSASignature decodeFromDER(byte[] bytes) {
    method toCanonicalised (line 146) | public ECDSASignature toCanonicalised() {
    method toBase64 (line 162) | public String toBase64() {
    method toByteArray (line 170) | public byte[] toByteArray() {
    method toHex (line 181) | public String toHex() {
    method equals (line 185) | @Override
    method bigIntegerToBytes (line 198) | public static byte[] bigIntegerToBytes(BigInteger b, int numBytes) {
    method merge (line 209) | public static byte[] merge(byte[]... arrays) {
    method bigIntegerToBytes (line 227) | public static byte[] bigIntegerToBytes(BigInteger value) {
    method bytesToBigInteger (line 248) | public static BigInteger bytesToBigInteger(byte[] bb) {
    method isLessThan (line 252) | public static boolean isLessThan(BigInteger valueA, BigInteger valueB) {
    method hashCode (line 256) | @Override

FILE: library/src/main/java/com/quincysx/crypto/ethereum/EthECKeyPair.java
  class EthECKeyPair (line 25) | public class EthECKeyPair extends ECKeyPair {
    method parse (line 26) | public static EthECKeyPair parse(Key keyPair) {
    method EthECKeyPair (line 30) | public EthECKeyPair(byte[] p) throws ValidationException {
    method EthECKeyPair (line 34) | public EthECKeyPair(BigInteger priv) {
    method EthECKeyPair (line 38) | public EthECKeyPair(Key keyPair) {
    method getRawPrivateKey (line 42) | @Override
    method getPrivateKey (line 47) | @Override
    method getRawPublicKey (line 52) | @Override
    method getPublicKey (line 59) | @Override
    method getRawAddress (line 64) | @Override
    method getAddress (line 72) | @Override
    method doSign (line 77) | public ECDSASignature doSign(byte[] input) {
    method sign (line 90) | public ECDSASignature sign(byte[] messageHash) {
    method recoverPubBytesFromSignature (line 108) | public static byte[] recoverPubBytesFromSignature(int recId, ECDSASign...
    method decompressKey (line 169) | private static ECPoint decompressKey(BigInteger xBN, boolean yBit) {
    method check (line 176) | private static void check(boolean test, String message) {

FILE: library/src/main/java/com/quincysx/crypto/ethereum/EthTransaction.java
  class EthTransaction (line 50) | public class EthTransaction implements Transaction {
    method EthTransaction (line 107) | public EthTransaction(byte[] rawData) {
    method EthTransaction (line 112) | public EthTransaction(byte[] nonce, byte[] gasPrice, byte[] gasLimit, ...
    method EthTransaction (line 140) | public EthTransaction(byte[] nonce, byte[] gasPrice, byte[] gasLimit, ...
    method EthTransaction (line 145) | public EthTransaction(byte[] nonce, byte[] gasPrice, byte[] gasLimit, ...
    method EthTransaction (line 158) | public EthTransaction(byte[] nonce, byte[] gasPrice, byte[] gasLimit, ...
    method extractChainIdFromV (line 165) | private Integer extractChainIdFromV(BigInteger bv) {
    method getRealV (line 173) | private byte getRealV(BigInteger bv) {
    method verify (line 192) | public synchronized void verify() {
    method rlpParse (line 197) | public synchronized void rlpParse() {
    method validate (line 234) | private void validate() {
    method isParsed (line 255) | public boolean isParsed() {
    method getHash (line 259) | public byte[] getHash() {
    method getRawHash (line 269) | public byte[] getRawHash() {
    method getNonce (line 277) | public byte[] getNonce() {
    method setNonce (line 283) | protected void setNonce(byte[] nonce) {
    method isValueTx (line 288) | public boolean isValueTx() {
    method getValue (line 293) | public byte[] getValue() {
    method setValue (line 298) | protected void setValue(byte[] value) {
    method getReceiveAddress (line 303) | public byte[] getReceiveAddress() {
    method setReceiveAddress (line 308) | protected void setReceiveAddress(byte[] receiveAddress) {
    method getGasPrice (line 313) | public byte[] getGasPrice() {
    method setGasPrice (line 318) | protected void setGasPrice(byte[] gasPrice) {
    method getGasLimit (line 323) | public byte[] getGasLimit() {
    method setGasLimit (line 328) | protected void setGasLimit(byte[] gasLimit) {
    method nonZeroDataBytes (line 333) | public long nonZeroDataBytes() {
    method zeroDataBytes (line 342) | public long zeroDataBytes() {
    method getData (line 352) | public byte[] getData() {
    method setData (line 357) | protected void setData(byte[] data) {
    method getSignature (line 362) | public ECDSASignature getSignature() {
    method isContractCreation (line 385) | public boolean isContractCreation() {
    method getChainId (line 411) | public Integer getChainId() {
    method sign (line 423) | @Override
    method getSignBytes (line 430) | @Override
    method toString (line 435) | @Override
    method toString (line 440) | public String toString(int maxDataSize) {
    method getEncodedRaw (line 471) | public byte[] getEncodedRaw() {
    method setSignature (line 504) | public void setSignature(ECDSASignature signature) {
    method getEncoded (line 508) | public byte[] getEncoded() {
    method hashCode (line 553) | @Override
    method equals (line 566) | @Override
    method createDefault (line 579) | public static EthTransaction createDefault(String to, BigInteger amoun...
    method createDefault (line 583) | public static EthTransaction createDefault(String to, BigInteger amoun...
    method create (line 592) | public static EthTransaction create(String to, BigInteger amount, BigI...
    method create (line 602) | public static EthTransaction create(String to, BigInteger amount, BigI...

FILE: library/src/main/java/com/quincysx/crypto/ethereum/config/Constants.java
  class Constants (line 27) | public class Constants {
    method getDURATION_LIMIT (line 44) | public int getDURATION_LIMIT() {
    method getInitialNonce (line 48) | public BigInteger getInitialNonce() {
    method getMAXIMUM_EXTRA_DATA_SIZE (line 52) | public int getMAXIMUM_EXTRA_DATA_SIZE() {
    method getMIN_GAS_LIMIT (line 56) | public int getMIN_GAS_LIMIT() {
    method getGAS_LIMIT_BOUND_DIVISOR (line 60) | public int getGAS_LIMIT_BOUND_DIVISOR() {
    method getMINIMUM_DIFFICULTY (line 64) | public BigInteger getMINIMUM_DIFFICULTY() {
    method getDIFFICULTY_BOUND_DIVISOR (line 68) | public BigInteger getDIFFICULTY_BOUND_DIVISOR() {
    method getEXP_DIFFICULTY_PERIOD (line 72) | public int getEXP_DIFFICULTY_PERIOD() {
    method getUNCLE_GENERATION_LIMIT (line 76) | public int getUNCLE_GENERATION_LIMIT() {
    method getUNCLE_LIST_LIMIT (line 80) | public int getUNCLE_LIST_LIMIT() {
    method getBEST_NUMBER_DIFF_LIMIT (line 84) | public int getBEST_NUMBER_DIFF_LIMIT() {
    method getBLOCK_REWARD (line 88) | public BigInteger getBLOCK_REWARD() {
    method getMAX_CONTRACT_SZIE (line 92) | public int getMAX_CONTRACT_SZIE() { return Integer.MAX_VALUE; }
    method createEmptyContractOnOOG (line 97) | public boolean createEmptyContractOnOOG() {
    method hasDelegateCallOpcode (line 105) | public boolean hasDelegateCallOpcode() {return false; }
    method getSECP256K1N (line 110) | public static BigInteger getSECP256K1N() {

FILE: library/src/main/java/com/quincysx/crypto/ethereum/keystore/CipherException.java
  class CipherException (line 3) | public class CipherException extends Exception {
    method CipherException (line 4) | public CipherException(String message) {
    method CipherException (line 8) | public CipherException(Throwable cause) {
    method CipherException (line 12) | public CipherException(String message, Throwable cause) {

FILE: library/src/main/java/com/quincysx/crypto/ethereum/keystore/KeyStore.java
  class KeyStore (line 28) | public class KeyStore {
    method createStandard (line 47) | public static KeyStoreFile createStandard(String password, EthECKeyPai...
    method createLight (line 52) | public static KeyStoreFile createLight(String password, EthECKeyPair e...
    method create (line 57) | public static KeyStoreFile create(String password, EthECKeyPair ecKeyP...
    method performCipherOperation (line 80) | private static byte[] performCipherOperation(
    method generateMac (line 97) | private static byte[] generateMac(byte[] derivedKey, byte[] cipherText) {
    method generateDerivedScryptKey (line 107) | private static byte[] generateDerivedScryptKey(
    method generateRandomBytes (line 112) | static byte[] generateRandomBytes(int size) {
    method createWalletFile (line 118) | private static KeyStoreFile createWalletFile(
    method validate (line 155) | static void validate(KeyStoreFile walletFile) throws CipherException {
    method decrypt (line 171) | public static EthECKeyPair decrypt(String password, KeyStoreFile walle...
    method generateAes128CtrDerivedKey (line 220) | private static byte[] generateAes128CtrDerivedKey(

FILE: library/src/main/java/com/quincysx/crypto/ethereum/keystore/KeyStoreFile.java
  class KeyStoreFile (line 16) | public class KeyStoreFile {
    method KeyStoreFile (line 23) | public KeyStoreFile() {
    method getAddress (line 26) | public String getAddress() {
    method setAddress (line 30) | public void setAddress(String address) {
    method getCrypto (line 34) | public Crypto getCrypto() {
    method setCrypto (line 38) | @JsonSetter("crypto")
    method setCryptoV1 (line 43) | @JsonSetter("Crypto")  // older wallet files may have this attribute name
    method getId (line 48) | public String getId() {
    method setId (line 52) | public void setId(String id) {
    method getVersion (line 56) | public int getVersion() {
    method setVersion (line 60) | public void setVersion(int version) {
    method parse (line 64) | public static KeyStoreFile parse(String keystore) throws IOException {
    method equals (line 69) | @Override
    method hashCode (line 98) | @Override
    class Crypto (line 107) | public static class Crypto {
      method Crypto (line 117) | public Crypto() {
      method getCipher (line 120) | public String getCipher() {
      method setCipher (line 124) | public void setCipher(String cipher) {
      method getCiphertext (line 128) | public String getCiphertext() {
      method setCiphertext (line 132) | public void setCiphertext(String ciphertext) {
      method getCipherparams (line 136) | public CipherParams getCipherparams() {
      method setCipherparams (line 140) | public void setCipherparams(CipherParams cipherparams) {
      method getKdf (line 144) | public String getKdf() {
      method setKdf (line 148) | public void setKdf(String kdf) {
      method getKdfparams (line 152) | public KdfParams getKdfparams() {
      method setKdfparams (line 156) | @JsonTypeInfo(
      method getMac (line 172) | public String getMac() {
      method setMac (line 176) | public void setMac(String mac) {
      method equals (line 180) | @Override
      method hashCode (line 220) | @Override
    class CipherParams (line 232) | public static class CipherParams {
      method CipherParams (line 235) | public CipherParams() {
      method getIv (line 238) | public String getIv() {
      method setIv (line 242) | public void setIv(String iv) {
      method equals (line 246) | @Override
      method hashCode (line 261) | @Override
    type KdfParams (line 269) | interface KdfParams {
      method getDklen (line 270) | int getDklen();
      method getSalt (line 272) | String getSalt();
    class Aes128CtrKdfParams (line 275) | public static class Aes128CtrKdfParams implements KdfParams {
      method Aes128CtrKdfParams (line 281) | public Aes128CtrKdfParams() {
      method getDklen (line 284) | public int getDklen() {
      method setDklen (line 288) | public void setDklen(int dklen) {
      method getC (line 292) | public int getC() {
      method setC (line 296) | public void setC(int c) {
      method getPrf (line 300) | public String getPrf() {
      method setPrf (line 304) | public void setPrf(String prf) {
      method getSalt (line 308) | public String getSalt() {
      method setSalt (line 312) | public void setSalt(String salt) {
      method equals (line 316) | @Override
      method hashCode (line 342) | @Override
    class ScryptKdfParams (line 353) | public static class ScryptKdfParams implements KdfParams {
      method ScryptKdfParams (line 360) | public ScryptKdfParams() {
      method getDklen (line 363) | public int getDklen() {
      method setDklen (line 367) | public void setDklen(int dklen) {
      method getN (line 371) | public int getN() {
      method setN (line 375) | public void setN(int n) {
      method getP (line 379) | public int getP() {
      method setP (line 383) | public void setP(int p) {
      method getR (line 387) | public int getR() {
      method setR (line 391) | public void setR(int r) {
      method getSalt (line 395) | public String getSalt() {
      method setSalt (line 399) | public void setSalt(String salt) {
      method equals (line 403) | @Override
      method hashCode (line 430) | @Override
    class KdfParamsDeserialiser (line 444) | static class KdfParamsDeserialiser extends JsonDeserializer<KdfParams> {
      method deserialize (line 446) | @Override
    method toString (line 468) | @Override

FILE: library/src/main/java/com/quincysx/crypto/ethereum/rlp/CompactEncoder.java
  class CompactEncoder (line 67) | public class CompactEncoder {
    method packNibbles (line 97) | public static byte[] packNibbles(byte[] nibbles) {
    method hasTerminator (line 120) | public static boolean hasTerminator(byte[] packedKey) {
    method unpackToNibbles (line 130) | public static byte[] unpackToNibbles(byte[] str) {
    method binToNibbles (line 150) | public static byte[] binToNibbles(byte[] str) {
    method binToNibblesNoTerminator (line 165) | public static byte[] binToNibblesNoTerminator(byte[] str) {

FILE: library/src/main/java/com/quincysx/crypto/ethereum/rlp/DecodeResult.java
  class DecodeResult (line 24) | @SuppressWarnings("serial")
    method DecodeResult (line 30) | public DecodeResult(int pos, Object decoded) {
    method getPos (line 35) | public int getPos() {
    method getDecoded (line 39) | public Object getDecoded() {
    method toString (line 43) | public String toString() {
    method asString (line 47) | private String asString(Object decoded) {

FILE: library/src/main/java/com/quincysx/crypto/ethereum/rlp/RLP.java
  class RLP (line 67) | public class RLP {
    method decodeOneByteItem (line 141) | private static byte decodeOneByteItem(byte[] data, int index) {
    method decodeInt (line 157) | public static int decodeInt(byte[] data, int index) {
    method decodeShort (line 189) | static short decodeShort(byte[] data, int index) {
    method decodeLong (line 217) | public static long decodeLong(byte[] data, int index) {
    method decodeStringItem (line 245) | private static String decodeStringItem(byte[] data, int index) {
    method decodeBigInteger (line 257) | public static BigInteger decodeBigInteger(byte[] data, int index) {
    method decodeByteArray (line 270) | private static byte[] decodeByteArray(byte[] data, int index) {
    method nextItemLength (line 275) | private static int nextItemLength(byte[] data, int index) {
    method decodeIP4Bytes (line 310) | public static byte[] decodeIP4Bytes(byte[] data, int index) {
    method getFirstListElement (line 327) | public static int getFirstListElement(byte[] payload, int pos) {
    method getNextElementIndex (line 351) | public static int getNextElementIndex(byte[] payload, int pos) {
    method fullTraverse (line 398) | public static void fullTraverse(byte[] msgData, int level, int startPos,
    method calcLength (line 511) | private static int calcLength(int lengthOfLength, byte[] msgData, int ...
    method getCommandCode (line 535) | public static byte getCommandCode(byte[] data) {
    method decode2 (line 548) | public static RLPList decode2(byte[] msgData) {
    method decode2OneItem (line 554) | public static RLPElement decode2OneItem(byte[] msgData, int startPos) {
    method fullTraverse (line 563) | private static void fullTraverse(byte[] msgData, int level, int startPos,
    method decode (line 709) | public static DecodeResult decode(byte[] data, int pos) {
    class LList (line 742) | public static final class LList {
      method LList (line 748) | public LList(byte[] rlp) {
      method getEncoded (line 752) | public byte[] getEncoded() {
      method add (line 760) | public void add(int off, int len, boolean isList) {
      method getBytes (line 766) | public byte[] getBytes(int idx) {
      method getList (line 774) | public LList getList(int idx) {
      method isList (line 778) | public boolean isList(int idx) {
      method size (line 782) | public int size() {
    method decodeLazyList (line 787) | public static LList decodeLazyList(byte[] data) {
    method decodeLazyList (line 791) | public static LList decodeLazyList(byte[] data, int pos, int length) {
    method decodeList (line 832) | private static DecodeResult decodeList(byte[] data, int pos, int prevP...
    method encode (line 857) | public static byte[] encode(Object input) {
    method encodeLength (line 884) | public static byte[] encodeLength(int length, int offset) {
    method encodeByte (line 901) | public static byte[] encodeByte(byte singleByte) {
    method encodeShort (line 911) | public static byte[] encodeShort(short singleShort) {
    method encodeInt (line 922) | public static byte[] encodeInt(int singleInt) {
    method encodeString (line 942) | public static byte[] encodeString(String srcString) {
    method encodeBigInteger (line 946) | public static byte[] encodeBigInteger(BigInteger srcBigInteger) {
    method encodeElement (line 956) | public static byte[] encodeElement(byte[] srcData) {
    method calcElementPrefixSize (line 1008) | public static int calcElementPrefixSize(byte[] srcData) {
    method encodeListHeader (line 1033) | public static byte[] encodeListHeader(int size) {
    method encodeLongElementHeader (line 1072) | public static byte[] encodeLongElementHeader(int length) {
    method encodeSet (line 1106) | public static byte[] encodeSet(Set<ByteArrayWrapper> data) {
    method encodeList (line 1132) | public static byte[] encodeList(byte[]... elements) {
    method toBytes (line 1181) | private static byte[] toBytes(Object input) {
    method decodeItemBytes (line 1204) | private static byte[] decodeItemBytes(byte[] data, int index) {
    method calculateItemLength (line 1240) | private static int calculateItemLength(byte[] data, int index) {

FILE: library/src/main/java/com/quincysx/crypto/ethereum/rlp/RLPElement.java
  type RLPElement (line 28) | public interface RLPElement extends Serializable {
    method getRLPData (line 30) | byte[] getRLPData();

FILE: library/src/main/java/com/quincysx/crypto/ethereum/rlp/RLPItem.java
  class RLPItem (line 24) | public class RLPItem implements RLPElement {
    method RLPItem (line 28) | public RLPItem(byte[] rlpData) {
    method getRLPData (line 32) | public byte[] getRLPData() {

FILE: library/src/main/java/com/quincysx/crypto/ethereum/rlp/RLPList.java
  class RLPList (line 28) | public class RLPList extends ArrayList<RLPElement> implements RLPElement {
    method setRLPData (line 32) | public void setRLPData(byte[] rlpData) {
    method getRLPData (line 36) | public byte[] getRLPData() {
    method recursivePrint (line 40) | public static void recursivePrint(RLPElement element) {

FILE: library/src/main/java/com/quincysx/crypto/ethereum/rlp/Value.java
  class Value (line 34) | public class Value {
    method fromRlpEncoded (line 42) | public static Value fromRlpEncoded(byte[] data) {
    method Value (line 52) | public Value() {
    method init (line 55) | public void init(byte[] rlp) {
    method Value (line 59) | public Value(Object obj) {
    method withHash (line 71) | public Value withHash(byte[] hash) {
    method asObj (line 80) | public Object asObj() {
    method asList (line 85) | public List<Object> asList() {
    method asInt (line 91) | public int asInt() {
    method asLong (line 101) | public long asLong() {
    method asBigInt (line 111) | public BigInteger asBigInt() {
    method asString (line 116) | public String asString() {
    method asBytes (line 126) | public byte[] asBytes() {
    method getHex (line 136) | public String getHex() {
    method getData (line 140) | public byte[] getData() {
    method asSlice (line 145) | public int[] asSlice() {
    method get (line 149) | public Value get(int index) {
    method decode (line 168) | public void decode() {
    method encode (line 175) | public byte[] encode() {
    method cmp (line 187) | public boolean cmp(Value o) {
    method isList (line 195) | public boolean isList() {
    method isString (line 200) | public boolean isString() {
    method isInt (line 205) | public boolean isInt() {
    method isLong (line 210) | public boolean isLong() {
    method isBigInt (line 215) | public boolean isBigInt() {
    method isBytes (line 220) | public boolean isBytes() {
    method isReadableString (line 226) | public boolean isReadableString() {
    method isHexString (line 244) | public boolean isHexString() {
    method isHashCode (line 260) | public boolean isHashCode() {
    method isNull (line 265) | public boolean isNull() {
    method isEmpty (line 270) | public boolean isEmpty() {
    method length (line 280) | public int length() {
    method toString (line 292) | public String toString() {
    method countBranchNodes (line 361) | public int countBranchNodes() {

FILE: library/src/main/java/com/quincysx/crypto/ethereum/solidity/SolidityType.java
  class SolidityType (line 34) | public abstract class SolidityType {
    method SolidityType (line 37) | public SolidityType(String name) {
    method getName (line 44) | public String getName() {
    method getCanonicalName (line 52) | @JsonValue
    method getType (line 57) | @JsonCreator
    method encode (line 75) | public abstract byte[] encode(Object value);
    method decode (line 77) | public abstract Object decode(byte[] encoded, int offset);
    method decode (line 79) | public Object decode(byte[] encoded) {
    method getFixedSize (line 87) | public int getFixedSize() {
    method isDynamicType (line 91) | public boolean isDynamicType() {
    method toString (line 95) | @Override
    class ArrayType (line 101) | public static abstract class ArrayType extends SolidityType {
      method getType (line 102) | public static ArrayType getType(String typeName) {
      method ArrayType (line 114) | public ArrayType(String name) {
      method encode (line 123) | @Override
      method getElementType (line 138) | public SolidityType getElementType() {
      method encodeList (line 142) | public abstract byte[] encodeList(List l);
    class StaticArrayType (line 145) | public static class StaticArrayType extends ArrayType {
      method StaticArrayType (line 148) | public StaticArrayType(String name) {
      method getCanonicalName (line 156) | @Override
      method encodeList (line 161) | @Override
      method decode (line 172) | @Override
      method getFixedSize (line 182) | @Override
    class DynamicArrayType (line 189) | public static class DynamicArrayType extends ArrayType {
      method DynamicArrayType (line 190) | public DynamicArrayType(String name) {
      method getCanonicalName (line 194) | @Override
      method encodeList (line 199) | @Override
      method decode (line 223) | @Override
      method isDynamicType (line 241) | @Override
    class BytesType (line 247) | public static class BytesType extends SolidityType {
      method BytesType (line 248) | protected BytesType(String name) {
      method BytesType (line 252) | public BytesType() {
      method encode (line 256) | @Override
      method decode (line 272) | @Override
      method isDynamicType (line 280) | @Override
    class StringType (line 286) | public static class StringType extends BytesType {
      method StringType (line 287) | public StringType() {
      method encode (line 291) | @Override
      method decode (line 303) | @Override
    class Bytes32Type (line 313) | public static class Bytes32Type extends SolidityType {
      method Bytes32Type (line 314) | public Bytes32Type(String s) {
      method encode (line 318) | @Override
      method decode (line 343) | @Override
    class AddressType (line 349) | public static class AddressType extends IntType {
      method AddressType (line 350) | public AddressType() {
      method encode (line 354) | @Override
      method decode (line 369) | @Override
    class IntType (line 376) | public static class IntType extends SolidityType {
      method IntType (line 377) | public IntType(String name) {
      method getCanonicalName (line 381) | @Override
      method encode (line 388) | @Override
      method decode (line 415) | @Override
      method decodeInt (line 420) | public static BigInteger decodeInt(byte[] encoded, int offset) {
      method encodeInt (line 424) | public static byte[] encodeInt(int i) {
      method encodeInt (line 428) | public static byte[] encodeInt(BigInteger bigInt) {
    class BoolType (line 433) | public static class BoolType extends IntType {
      method BoolType (line 434) | public BoolType() {
      method encode (line 438) | @Override
      method decode (line 445) | @Override
    class FunctionType (line 451) | public static class FunctionType extends Bytes32Type {
      method FunctionType (line 452) | public FunctionType() {
      method encode (line 456) | @Override

FILE: library/src/main/java/com/quincysx/crypto/ethereum/utils/ByteUtil.java
  class ByteUtil (line 35) | public class ByteUtil {
    method appendByte (line 43) | public static byte[] appendByte(byte[] bytes, byte b) {
    method bigIntegerToBytes (line 57) | public static byte[] bigIntegerToBytes(BigInteger b, int numBytes) {
    method bigIntegerToBytesSigned (line 68) | public static byte[] bigIntegerToBytesSigned(BigInteger b, int numByte...
    method bigIntegerToBytes (line 90) | public static byte[] bigIntegerToBytes(BigInteger value) {
    method bytesToBigInteger (line 111) | public static BigInteger bytesToBigInteger(byte[] bb) {
    method matchingNibbleLength (line 123) | public static int matchingNibbleLength(byte[] a, byte[] b) {
    method longToBytes (line 140) | public static byte[] longToBytes(long val) {
    method longToBytesNoLeadZeroes (line 150) | public static byte[] longToBytesNoLeadZeroes(long val) {
    method intToBytes (line 166) | public static byte[] intToBytes(int val){
    method intToBytesNoLeadZeroes (line 176) | public static byte[] intToBytesNoLeadZeroes(int val){
    method toHexString (line 213) | public static String toHexString(byte[] data) {
    method calcPacketLength (line 223) | public static byte[] calcPacketLength(byte[] msg) {
    method byteArrayToInt (line 241) | public static int byteArrayToInt(byte[] b) {
    method byteArrayToLong (line 256) | public static long byteArrayToLong(byte[] b) {
    method nibblesToPrettyString (line 272) | public static String nibblesToPrettyString(byte[] nibbles) {
    method oneByteToHexString (line 281) | public static String oneByteToHexString(byte value) {
    method numBytes (line 294) | public static int numBytes(String val) {
    method encodeValFor32Bits (line 311) | public static byte[] encodeValFor32Bits(Object arg) {
    method encodeDataList (line 344) | public static byte[] encodeDataList(Object... args) {
    method firstNonZeroByte (line 357) | public static int firstNonZeroByte(byte[] data) {
    method stripLeadingZeroes (line 366) | public static byte[] stripLeadingZeroes(byte[] data) {
    method increment (line 393) | public static boolean increment(byte[] bytes) {
    method copyToArray (line 413) | public static byte[] copyToArray(BigInteger value) {
    method setBit (line 425) | public static byte[] setBit(byte[] data, int pos, int val) {
    method getBit (line 444) | public static int getBit(byte[] data, int pos) {
    method and (line 455) | public static byte[] and(byte[] b1, byte[] b2) {
    method or (line 464) | public static byte[] or(byte[] b1, byte[] b2) {
    method xor (line 473) | public static byte[] xor(byte[] b1, byte[] b2) {
    method xorAlignRight (line 485) | public static byte[] xorAlignRight(byte[] b1, byte[] b2) {
    method merge (line 503) | public static byte[] merge(byte[]... arrays)
    method isNullOrZeroArray (line 523) | public static boolean isNullOrZeroArray(byte[] array){
    method isSingleZero (line 527) | public static boolean isSingleZero(byte[] array){
    method difference (line 532) | public static Set<byte[]> difference(Set<byte[]> setA, Set<byte[]> setB){
    method length (line 551) | public static int length(byte[]... bytes) {
    method intsToBytes (line 559) | public static byte[] intsToBytes(int[] arr, boolean bigEndian) {
    method bytesToInts (line 565) | public static int[] bytesToInts(byte[] arr, boolean bigEndian) {
    method bytesToInts (line 571) | public static void bytesToInts(byte[] b, int[] arr, boolean bigEndian) {
    method intsToBytes (line 593) | public static void intsToBytes(int[] arr, byte[] b, boolean bigEndian) {
    method bigEndianToShort (line 615) | public static short bigEndianToShort(byte[] bs) {
    method bigEndianToShort (line 619) | public static short bigEndianToShort(byte[] bs, int off) {
    method shortToBytes (line 626) | public static byte[] shortToBytes(short n) {
    method hexStringToBytes (line 638) | public static byte[] hexStringToBytes(String data) {
    method hostToBytes (line 648) | public static byte[] hostToBytes(String ip) {
    method bytesToIp (line 662) | public static String bytesToIp(byte[] bytesIp) {
    method numberOfLeadingZeros (line 681) | public static int numberOfLeadingZeros(byte[] bytes) {
    method parseBytes (line 698) | public static byte[] parseBytes(byte[] input, int offset, int len) {
    method parseWord (line 715) | public static byte[] parseWord(byte[] input, int idx) {
    method parseWord (line 727) | public static byte[] parseWord(byte[] input, int offset, int idx) {

FILE: library/src/main/java/com/quincysx/crypto/ethereum/utils/FastByteComparisons.java
  class FastByteComparisons (line 44) | @SuppressWarnings("restriction")
    method equal (line 47) | public static boolean equal(byte[] b1, byte[] b2) {
    method compareTo (line 61) | public static int compareTo(byte[] b1, int s1, int l1, byte[] b2, int ...
    type Comparer (line 66) | private interface Comparer<T> {
      method compareTo (line 67) | int compareTo(T buffer1, int offset1, int length1,
    method lexicographicalComparerJavaImpl (line 71) | private static Comparer<byte[]> lexicographicalComparerJavaImpl() {
    class LexicographicalComparerHolder (line 81) | private static class LexicographicalComparerHolder {
      method getBestComparer (line 91) | static Comparer<byte[]> getBestComparer() {
      type PureJavaComparer (line 105) | private enum PureJavaComparer implements Comparer<byte[]> {
        method compareTo (line 108) | @Override

FILE: library/src/main/java/com/quincysx/crypto/ethereum/vm/DataWord.java
  class DataWord (line 39) | public class DataWord implements Comparable<DataWord> {
    method DataWord (line 49) | public DataWord() {
    method DataWord (line 52) | public DataWord(int num) {
    method DataWord (line 56) | public DataWord(long num) {
    method DataWord (line 60) | private DataWord(ByteBuffer buffer) {
    method DataWord (line 67) | @JsonCreator
    method DataWord (line 72) | public DataWord(ByteArrayWrapper wrappedData){
    method DataWord (line 76) | public DataWord(byte[] data) {
    method getData (line 87) | public byte[] getData() {
    method getNoLeadZeroesData (line 91) | public byte[] getNoLeadZeroesData() {
    method getLast20Bytes (line 95) | public byte[] getLast20Bytes() {
    method value (line 99) | public BigInteger value() {
    method intValue (line 111) | public int intValue() {
    method intValueSafe (line 126) | public int intValueSafe() {
    method longValue (line 141) | public long longValue() {
    method longValueSafe (line 156) | public long longValueSafe() {
    method sValue (line 163) | public BigInteger sValue() {
    method bigIntValue (line 167) | public String  bigIntValue() {
    method isZero (line 171) | public boolean isZero() {
    method isNegative (line 181) | public boolean isNegative() {
    method and (line 186) | public DataWord and(DataWord w2) {
    method or (line 194) | public DataWord or(DataWord w2) {
    method xor (line 202) | public DataWord xor(DataWord w2) {
    method negate (line 210) | public void negate() {
    method bnot (line 224) | public void bnot() {
    method add (line 234) | public void add(DataWord word) {
    method add2 (line 245) | public void add2(DataWord word) {
    method mul (line 253) | public void mul(DataWord word) {
    method div (line 259) | public void div(DataWord word) {
    method sDiv (line 271) | public void sDiv(DataWord word) {
    method sub (line 283) | public void sub(DataWord word) {
    method exp (line 289) | public void exp(DataWord word) {
    method mod (line 295) | public void mod(DataWord word) {
    method sMod (line 306) | public void sMod(DataWord word) {
    method addmod (line 319) | public void addmod(DataWord word1, DataWord word2) {
    method mulmod (line 329) | public void mulmod(DataWord word1, DataWord word2) {
    method toString (line 340) | @JsonValue
    method toPrefixString (line 346) | public String toPrefixString() {
    method shortHex (line 357) | public String shortHex() {
    method clone (line 362) | public DataWord clone() {
    method equals (line 366) | @Override
    method hashCode (line 377) | @Override
    method compareTo (line 382) | @Override
    method signExtend (line 392) | public void signExtend(byte k) {
    method bytesOccupied (line 401) | public int bytesOccupied() {
    method isHex (line 407) | public boolean isHex(String hex) {
    method asString (line 411) | public String asString(){

FILE: library/src/main/java/com/quincysx/crypto/ethereum/vm/LogInfo.java
  class LogInfo (line 37) | public class LogInfo {
    method LogInfo (line 46) | public LogInfo(byte[] rlp) {
    method LogInfo (line 66) | public LogInfo(byte[] address, List<DataWord> topics, byte[] data) {
    method getAddress (line 72) | public byte[] getAddress() {
    method getTopics (line 76) | public List<DataWord> getTopics() {
    method getData (line 80) | public byte[] getData() {
    method getEncoded (line 85) | public byte[] getEncoded() {
    method getBloom (line 104) | public Bloom getBloom() {
    method toString (line 115) | @Override

FILE: library/src/main/java/com/quincysx/crypto/exception/CoinNotFindException.java
  class CoinNotFindException (line 7) | public class CoinNotFindException extends Exception {
    method CoinNotFindException (line 8) | public CoinNotFindException(String message) {

FILE: library/src/main/java/com/quincysx/crypto/exception/NonSupportException.java
  class NonSupportException (line 7) | public class NonSupportException extends Exception {
    method NonSupportException (line 8) | public NonSupportException(String message) {

FILE: library/src/main/java/com/quincysx/crypto/utils/BTCUtils.java
  class BTCUtils (line 24) | public class BTCUtils {
    method reverse (line 25) | public static byte[] reverse(byte[] bytes) {
    method verify (line 33) | public static void verify(BTCTransaction.Script[] scripts, BTCTransact...
    method verify (line 44) | public static boolean verify(byte[] publicKey, byte[] signature, byte[...

FILE: library/src/main/java/com/quincysx/crypto/utils/Base58.java
  class Base58 (line 9) | public final class Base58 {
    method decode (line 30) | public static byte[] decode(String input) {
    method encode (line 83) | public static String encode(byte[] input) {

FILE: library/src/main/java/com/quincysx/crypto/utils/Base58Check.java
  class Base58Check (line 20) | public final class Base58Check {
    method bytesToBase58 (line 25) | public static String bytesToBase58(byte[] data) {
    method rawBytesToBase58 (line 31) | static String rawBytesToBase58(byte[] data) {
    method addCheckHash (line 49) | static byte[] addCheckHash(byte[] data) {
    method base58ToBytes (line 64) | public static byte[] base58ToBytes(String s) {
    method base58ToRawBytes (line 76) | static byte[] base58ToRawBytes(String s) {
    method Base58Check (line 115) | private Base58Check() {

FILE: library/src/main/java/com/quincysx/crypto/utils/Base64.java
  class Base64 (line 11) | public class Base64 {
    method decode (line 12) | public static String decode(String input) {
    method encode (line 16) | public static String encode(BigInteger input) {
    method encode (line 20) | public static String encode(byte[] input) {

FILE: library/src/main/java/com/quincysx/crypto/utils/HexUtils.java
  class HexUtils (line 7) | public final class HexUtils {
    method toHex (line 8) | public static String toHex(byte[] bytes) {
    method fromHex (line 23) | public static byte[] fromHex(String s) {

FILE: library/src/main/java/com/quincysx/crypto/utils/HmacSha512.java
  class HmacSha512 (line 31) | public final class HmacSha512 {
    method hmacSha512 (line 34) | public static byte[] hmacSha512(final byte[] byteKey, final byte[] see...
    method initialize (line 39) | private static Mac initialize(final byte[] byteKey) {
    method getInstance (line 50) | private static Mac getInstance(final String HMAC_SHA256) {

FILE: library/src/main/java/com/quincysx/crypto/utils/KECCAK256.java
  class KECCAK256 (line 9) | public class KECCAK256 {
    method keccak256 (line 12) | public static byte[] keccak256(byte[] bytes) {
    method keccak256 (line 16) | public static byte[] keccak256(byte[] bytes, int offset, int size) {

FILE: library/src/main/java/com/quincysx/crypto/utils/RIPEMD160.java
  class RIPEMD160 (line 13) | public final class RIPEMD160 {
    method ripemd160 (line 16) | public static byte[] ripemd160(byte[] bytes) {
    method hash160 (line 24) | public static byte[] hash160(final byte[] bytes) {

FILE: library/src/main/java/com/quincysx/crypto/utils/SHA256.java
  class SHA256 (line 14) | public final class SHA256 {
    method sha256 (line 15) | public static byte[] sha256(byte[] bytes) {
    method sha256 (line 19) | public static byte[] sha256(byte[] bytes, int offset, int size) {
    method doubleSha256 (line 27) | public static byte[] doubleSha256(byte[] bytes) {
    method doubleSha256 (line 31) | public static byte[] doubleSha256(byte[] bytes, int offset, int size) {

FILE: library/src/test/java/com/quincysx/crypto/Bip32UnitTest.java
  class Bip32UnitTest (line 18) | public class Bip32UnitTest {
    method addition_isCorrect (line 19) | @Test

FILE: library/src/test/java/com/quincysx/crypto/Bip39UnitTest.java
  class Bip39UnitTest (line 29) | public class Bip39UnitTest {
    method addition_isCorrect (line 30) | @Test
    method mnemonic (line 35) | @Test
    method mnemonicResetByThreeList (line 42) | @Test
    method mnemonicResetByList (line 56) | @Test

FILE: library/src/test/java/com/quincysx/crypto/Bip44UnitTest.java
  class Bip44UnitTest (line 11) | public class Bip44UnitTest {
    method addition_isCorrect (line 12) | @Test

FILE: library/src/test/java/com/quincysx/crypto/Eip55UnitTest.java
  class Eip55UnitTest (line 15) | public class Eip55UnitTest {
    method addition_isCorrect (line 16) | @Test

FILE: library/src/test/java/com/quincysx/crypto/ExampleUnitTest.java
  class ExampleUnitTest (line 17) | public class ExampleUnitTest {
    method addition_isCorrect (line 18) | @Test

FILE: library/src/test/java/com/quincysx/crypto/HashUnitTest.java
  class HashUnitTest (line 18) | public class HashUnitTest {
    method addition_isCorrect (line 19) | @Test
    method testKeccak256 (line 24) | @Test
    method testSha256 (line 31) | @Test
    method testDoubleSha256 (line 42) | @Test
    method testRipemd160 (line 49) | @Test
    method testHash160 (line 56) | @Test
    method testBase64Encode (line 63) | @Test
    method testBase64Decode (line 70) | @Test

FILE: sample/src/androidTest/java/com/quincysx/crypto/ExampleInstrumentedTest.java
  class ExampleInstrumentedTest (line 17) | @RunWith(AndroidJUnit4.class)
    method useAppContext (line 19) | @Test

FILE: sample/src/main/java/com/quincysx/crypto/smpale/Main1Activity.java
  class Main1Activity (line 40) | public class Main1Activity extends AppCompatActivity {
    method onCreate (line 42) | @Override

FILE: sample/src/main/java/com/quincysx/crypto/smpale/MainActivity.java
  class MainActivity (line 32) | public class MainActivity extends AppCompatActivity {
    method onCreate (line 34) | @Override

FILE: sample/src/test/java/com/quincysx/crypto/ExampleUnitTest.java
  class ExampleUnitTest (line 19) | public class ExampleUnitTest {
    method addition_isCorrect (line 20) | @Test
Condensed preview — 122 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (735K chars).
[
  {
    "path": ".gitignore",
    "chars": 125,
    "preview": "*.iml\n.gradle\n/local.properties\n/.idea/workspace.xml\n/.idea/libraries\n.idea/\n.DS_Store\n/build\n/captures\n.externalNativeB"
  },
  {
    "path": "LICENSE",
    "chars": 35147,
    "preview": "                    GNU GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\n Copyright (C) 2007 Free "
  },
  {
    "path": "README.md",
    "chars": 1045,
    "preview": "# BlockchainWallet-Crypto\n[![](https://jitpack.io/v/QuincySx/BlockchainWallet-Crypto.svg)](https://jitpack.io/#QuincySx/"
  },
  {
    "path": "build.gradle",
    "chars": 546,
    "preview": "// Top-level build file where you can add configuration options common to all sub-projects/modules.\n\nbuildscript {\n    \n"
  },
  {
    "path": "gradle/wrapper/gradle-wrapper.properties",
    "chars": 230,
    "preview": "#Tue Mar 27 20:02:31 CST 2018\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER_"
  },
  {
    "path": "gradle.properties",
    "chars": 730,
    "preview": "# Project-wide Gradle settings.\n\n# IDE (e.g. Android Studio) users:\n# Gradle settings configured through the IDE *will o"
  },
  {
    "path": "gradlew",
    "chars": 4971,
    "preview": "#!/usr/bin/env bash\n\n##############################################################################\n##\n##  Gradle start "
  },
  {
    "path": "gradlew.bat",
    "chars": 2404,
    "preview": "@if \"%DEBUG%\" == \"\" @echo off\r\n@rem ##########################################################################\r\n@rem\r\n@r"
  },
  {
    "path": "library/.gitignore",
    "chars": 7,
    "preview": "/build\n"
  },
  {
    "path": "library/build.gradle",
    "chars": 777,
    "preview": "apply plugin: 'com.android.library'\n\nandroid {\n    compileSdkVersion 27\n\n\n\n    defaultConfig {\n        minSdkVersion 15\n"
  },
  {
    "path": "library/proguard-rules.pro",
    "chars": 751,
    "preview": "# Add project specific ProGuard rules here.\n# You can control the set of applied configuration files using the\n# proguar"
  },
  {
    "path": "library/src/androidTest/java/com/quincysx/crypto/ExampleInstrumentedTest.java",
    "chars": 744,
    "preview": "package com.quincysx.crypto;\n\nimport android.content.Context;\nimport android.support.test.InstrumentationRegistry;\nimpor"
  },
  {
    "path": "library/src/main/AndroidManifest.xml",
    "chars": 106,
    "preview": "<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package=\"com.quincysx.crypto\" />\n"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/CoinTypes.java",
    "chars": 891,
    "preview": "package com.quincysx.crypto;\n\nimport com.quincysx.crypto.exception.CoinNotFindException;\n\n/**\n * Created by q7728 on 201"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/ECKeyPair.java",
    "chars": 6603,
    "preview": "/*\n * Copyright 2013 bits of proof zrt.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/ECPublicKey.java",
    "chars": 2381,
    "preview": "/*\n * Copyright 2013 bits of proof zrt.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/Key.java",
    "chars": 1649,
    "preview": "/*\n * Copyright 2013 bits of proof zrt.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/SecureCharSequence.java",
    "chars": 2049,
    "preview": "package com.quincysx.crypto;\n\nimport java.security.SecureRandom;\nimport java.util.Arrays;\n\n/**\n * @author QuincySx\n * @d"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/Transaction.java",
    "chars": 352,
    "preview": "package com.quincysx.crypto;\n\nimport com.quincysx.crypto.bip32.ValidationException;\n\n/**\n * @author QuincySx\n * @date 20"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/TrulySecureRandom.java",
    "chars": 6422,
    "preview": "/*\n The MIT License (MIT)\n\n Copyright (c) 2013 Valentin Konovalov\n\n Permission is hereby granted, free of charge, to any"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/bip32/ExtendedKey.java",
    "chars": 14595,
    "preview": "/*\n * Copyright 2013 bits of proof zrt.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/bip32/Index.java",
    "chars": 323,
    "preview": "package com.quincysx.crypto.bip32;\n\n/**\n * @author QuincySx\n * @date 2018/3/5 下午4:29\n */\npublic final class Index {\n    "
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/bip32/ValidationException.java",
    "chars": 975,
    "preview": "/*\n * Copyright 2013 bits of proof zrt.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/bip38/Bip38.java",
    "chars": 16244,
    "preview": "package com.quincysx.crypto.bip38;\n\n\nimport com.quincysx.crypto.bip32.ValidationException;\nimport com.quincysx.crypto.bi"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/bip38/Rijndael.java",
    "chars": 21609,
    "preview": "package com.quincysx.crypto.bip38;\n\n/**\n * @author QuincySx\n * @date 2018/3/9 下午2:09\n */\npublic final class Rijndael {\n\n"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/bip39/ByteUtils.java",
    "chars": 1345,
    "preview": "package com.quincysx.crypto.bip39;\n\n/**\n * @author QuincySx\n * @date 2018/5/15 上午10:34\n */\nfinal class ByteUtils {\n    s"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/bip39/CharSequenceComparators.java",
    "chars": 717,
    "preview": "package com.quincysx.crypto.bip39;\n\nimport java.util.Comparator;\n\n/**\n * @author QuincySx\n * @date 2018/5/15 上午11:25\n */"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/bip39/CharSequenceSplitter.java",
    "chars": 962,
    "preview": "package com.quincysx.crypto.bip39;\n\nimport java.util.LinkedList;\nimport java.util.List;\n\n/**\n * @author QuincySx\n * @dat"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/bip39/MnemonicGenerator.java",
    "chars": 3395,
    "preview": "package com.quincysx.crypto.bip39;\n\nimport com.quincysx.crypto.utils.SHA256;\n\nimport java.util.ArrayList;\nimport java.ut"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/bip39/MnemonicValidator.java",
    "chars": 6667,
    "preview": "package com.quincysx.crypto.bip39;\n\nimport com.quincysx.crypto.bip39.validation.InvalidChecksumException;\nimport com.qui"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/bip39/NFKDNormalizer.java",
    "chars": 176,
    "preview": "package com.quincysx.crypto.bip39;\n\n/**\n * @author QuincySx\n * @date 2018/5/15 上午10:41\n */\npublic interface NFKDNormaliz"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/bip39/Normalization.java",
    "chars": 380,
    "preview": "package com.quincysx.crypto.bip39;\n\nimport java.text.Normalizer;\n\n/**\n * @author QuincySx\n * @date 2018/5/15 上午10:40\n */"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/bip39/PBKDF2WithHmacSHA512.java",
    "chars": 189,
    "preview": "package com.quincysx.crypto.bip39;\n\n/**\n * @author QuincySx\n * @date 2018/5/15 上午10:18\n */\npublic interface PBKDF2WithHm"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/bip39/RandomSeed.java",
    "chars": 483,
    "preview": "package com.quincysx.crypto.bip39;\n\nimport java.security.SecureRandom;\nimport java.util.Random;\n\n/**\n * @author QuincySx"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/bip39/SeedCalculator.java",
    "chars": 3879,
    "preview": "package com.quincysx.crypto.bip39;\n\nimport android.util.Log;\n\nimport com.quincysx.crypto.utils.HexUtils;\n\nimport java.io"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/bip39/SeedCalculatorByWordListLookUp.java",
    "chars": 3155,
    "preview": "package com.quincysx.crypto.bip39;\n\nimport java.util.Arrays;\nimport java.util.Collection;\nimport java.util.HashMap;\nimpo"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/bip39/SpongyCastlePBKDF2WithHmacSHA512.java",
    "chars": 797,
    "preview": "package com.quincysx.crypto.bip39;\n\nimport org.spongycastle.crypto.PBEParametersGenerator;\nimport org.spongycastle.crypt"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/bip39/WordCount.java",
    "chars": 745,
    "preview": "package com.quincysx.crypto.bip39;\n\n/**\n * @author QuincySx\n * @date 2018/3/2 下午4:27\n * 词语个数的枚举\n */\npublic enum WordCoun"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/bip39/WordList.java",
    "chars": 1320,
    "preview": "/*\n *  BIP39 library, a Java implementation of BIP39\n *  Copyright (C) 2017 Alan Evans, NovaCrypto\n *\n *  This program i"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/bip39/WordListMapNormalization.java",
    "chars": 1055,
    "preview": "package com.quincysx.crypto.bip39;\n\nimport java.text.Normalizer;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n *"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/bip39/exception/MnemonicException.java",
    "chars": 1895,
    "preview": "/*\n *\n *  * Copyright 2014 http://Bither.net\n *  *\n *  * Licensed under the Apache License, Version 2.0 (the \"License\");"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/bip39/validation/InvalidChecksumException.java",
    "chars": 243,
    "preview": "package com.quincysx.crypto.bip39.validation;\n\n/**\n * @author QuincySx\n * @date 2018/5/15 上午11:19\n */\npublic class Inval"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/bip39/validation/InvalidWordCountException.java",
    "chars": 258,
    "preview": "package com.quincysx.crypto.bip39.validation;\n\n/**\n * @author QuincySx\n * @date 2018/5/15 上午11:20\n */\npublic class Inval"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/bip39/validation/UnexpectedWhiteSpaceException.java",
    "chars": 258,
    "preview": "package com.quincysx.crypto.bip39.validation;\n\n/**\n * @author QuincySx\n * @date 2018/5/15 上午11:20\n */\npublic class Unexp"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/bip39/validation/WordNotFoundException.java",
    "chars": 971,
    "preview": "package com.quincysx.crypto.bip39.validation;\n\n/**\n * @author QuincySx\n * @date 2018/5/15 上午11:20\n */\npublic class WordN"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/bip39/wordlists/English.java",
    "chars": 45571,
    "preview": "/*\n *  BIP39 library, a Java implementation of BIP39\n *  Copyright (C) 2017 Alan Evans, NovaCrypto\n *\n *  This program i"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/bip39/wordlists/French.java",
    "chars": 48453,
    "preview": "/*\n *  BIP39 library, a Java implementation of BIP39\n *  Copyright (C) 2017 Alan Evans, NovaCrypto\n *\n *  This program i"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/bip39/wordlists/Japanese.java",
    "chars": 41943,
    "preview": "/*\n *  BIP39 library, a Java implementation of BIP39\n *  Copyright (C) 2017 Alan Evans, NovaCrypto\n *\n *  This program i"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/bip39/wordlists/Spanish.java",
    "chars": 46114,
    "preview": "/*\n *  BIP39 library, a Java implementation of BIP39\n *  Copyright (C) 2017 Alan Evans, NovaCrypto\n *\n *  This program i"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/bip44/Account.java",
    "chars": 1676,
    "preview": "package com.quincysx.crypto.bip44;\n\nimport com.quincysx.crypto.bip32.Index;\n\n/**\n * @author QuincySx\n * @date 2018/3/5 下"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/bip44/AddressIndex.java",
    "chars": 1017,
    "preview": "package com.quincysx.crypto.bip44;\n\nimport com.quincysx.crypto.bip32.Index;\n\n/**\n * @author QuincySx\n * @date 2018/3/5 下"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/bip44/BIP44.java",
    "chars": 2275,
    "preview": "package com.quincysx.crypto.bip44;\n\nimport android.util.Log;\n\nimport com.quincysx.crypto.CoinTypes;\nimport com.quincysx."
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/bip44/Change.java",
    "chars": 1087,
    "preview": "package com.quincysx.crypto.bip44;\n\n/**\n * @author QuincySx\n * @date 2018/3/5 下午4:28\n */\npublic class Change {\n    priva"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/bip44/CoinPairDerive.java",
    "chars": 2752,
    "preview": "package com.quincysx.crypto.bip44;\n\nimport android.util.Log;\n\nimport com.quincysx.crypto.CoinTypes;\nimport com.quincysx."
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/bip44/CoinType.java",
    "chars": 975,
    "preview": "package com.quincysx.crypto.bip44;\n\n\nimport com.quincysx.crypto.CoinTypes;\n\n/**\n * @author QuincySx\n * @date 2018/3/5 下午"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/bip44/M.java",
    "chars": 946,
    "preview": "package com.quincysx.crypto.bip44;\n\n/**\n * @author QuincySx\n * @date 2018/3/5 下午4:25\n */\npublic final class M {\n    priv"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/bip44/Purpose.java",
    "chars": 961,
    "preview": "package com.quincysx.crypto.bip44;\n\nimport com.quincysx.crypto.CoinTypes;\nimport com.quincysx.crypto.bip32.Index;\n\n/**\n "
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/bitcoin/BTCTransaction.java",
    "chars": 28393,
    "preview": "/*\n The MIT License (MIT)\n\n Copyright (c) 2013 Valentin Konovalov\n\n Permission is hereby granted, free of charge, to any"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/bitcoin/BitCoinECKeyPair.java",
    "chars": 11575,
    "preview": "package com.quincysx.crypto.bitcoin;\n\nimport com.quincysx.crypto.ECKeyPair;\nimport com.quincysx.crypto.Key;\nimport com.q"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/bitcoin/BitcoinException.java",
    "chars": 2383,
    "preview": "/*\n The MIT License (MIT)\n\n Copyright (c) 2013-2014 Valentin Konovalov\n\n Permission is hereby granted, free of charge, t"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/bitcoin/BitcoinInputStream.java",
    "chars": 2967,
    "preview": "/*\n The MIT License (MIT)\n\n Copyright (c) 2013 Valentin Konovalov\n\n Permission is hereby granted, free of charge, to any"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/bitcoin/BitcoinOutputStream.java",
    "chars": 2150,
    "preview": "/*\n The MIT License (MIT)\n\n Copyright (c) 2013 Valentin Konovalov\n\n Permission is hereby granted, free of charge, to any"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/eip55/EthCheckAddress.java",
    "chars": 2734,
    "preview": "package com.quincysx.crypto.eip55;\n\nimport com.quincysx.crypto.utils.HexUtils;\nimport com.quincysx.crypto.utils.KECCAK25"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/eos/EOSECKeyPair.java",
    "chars": 3585,
    "preview": "package com.quincysx.crypto.eos;\n\nimport com.quincysx.crypto.ECKeyPair;\nimport com.quincysx.crypto.Key;\nimport com.quinc"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/ethereum/Bloom.java",
    "chars": 2840,
    "preview": "/*\n * Copyright (c) [2016] [ <ether.camp> ]\n * This file is part of the ethereumJ library.\n *\n * The ethereumJ library i"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/ethereum/ByteArrayWrapper.java",
    "chars": 2171,
    "preview": "/*\n * Copyright (c) [2016] [ <ether.camp> ]\n * This file is part of the ethereumJ library.\n *\n * The ethereumJ library i"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/ethereum/CallTransaction.java",
    "chars": 14042,
    "preview": "/*\n * Copyright (c) [2016] [ <ether.camp> ]\n * This file is part of the ethereumJ library.\n *\n * The ethereumJ library i"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/ethereum/ECDSASignature.java",
    "chars": 8794,
    "preview": "package com.quincysx.crypto.ethereum;\n\nimport com.quincysx.crypto.ethereum.config.Constants;\nimport com.quincysx.crypto."
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/ethereum/EthECKeyPair.java",
    "chars": 7310,
    "preview": "package com.quincysx.crypto.ethereum;\n\nimport com.quincysx.crypto.ECKeyPair;\nimport com.quincysx.crypto.Key;\nimport com."
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/ethereum/EthTransaction.java",
    "chars": 21365,
    "preview": "/*\n * Copyright (c) [2016] [ <ether.camp> ]\n * This file is part of the ethereumJ library.\n *\n * The ethereumJ library i"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/ethereum/config/Constants.java",
    "chars": 3388,
    "preview": "/*\n * Copyright (c) [2016] [ <ether.camp> ]\n * This file is part of the ethereumJ library.\n *\n * The ethereumJ library i"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/ethereum/keystore/CipherException.java",
    "chars": 349,
    "preview": "package com.quincysx.crypto.ethereum.keystore;\n\npublic class CipherException extends Exception {\n    public CipherExcept"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/ethereum/keystore/KeyStore.java",
    "chars": 9281,
    "preview": "package com.quincysx.crypto.ethereum.keystore;\n\nimport com.quincysx.crypto.bip32.ValidationException;\nimport com.quincys"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/ethereum/keystore/KeyStoreFile.java",
    "chars": 12993,
    "preview": "package com.quincysx.crypto.ethereum.keystore;\n\nimport com.fasterxml.jackson.annotation.JsonSetter;\nimport com.fasterxml"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/ethereum/rlp/CompactEncoder.java",
    "chars": 6273,
    "preview": "/*\n * Copyright (c) [2016] [ <ether.camp> ]\n * This file is part of the ethereumJ library.\n *\n * The ethereumJ library i"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/ethereum/rlp/DecodeResult.java",
    "chars": 1882,
    "preview": "/*\n * Copyright (c) [2016] [ <ether.camp> ]\n * This file is part of the ethereumJ library.\n *\n * The ethereumJ library i"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/ethereum/rlp/RLP.java",
    "chars": 47347,
    "preview": "/*\n * Copyright (c) [2016] [ <ether.camp> ]\n * This file is part of the ethereumJ library.\n *\n * The ethereumJ library i"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/ethereum/rlp/RLPElement.java",
    "chars": 1071,
    "preview": "/*\n * Copyright (c) [2016] [ <ether.camp> ]\n * This file is part of the ethereumJ library.\n *\n * The ethereumJ library i"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/ethereum/rlp/RLPItem.java",
    "chars": 1167,
    "preview": "/*\n * Copyright (c) [2016] [ <ether.camp> ]\n * This file is part of the ethereumJ library.\n *\n * The ethereumJ library i"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/ethereum/rlp/RLPList.java",
    "chars": 1787,
    "preview": "/*\n * Copyright (c) [2016] [ <ether.camp> ]\n * This file is part of the ethereumJ library.\n *\n * The ethereumJ library i"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/ethereum/rlp/Value.java",
    "chars": 9591,
    "preview": "/*\n * Copyright (c) [2016] [ <ether.camp> ]\n * This file is part of the ethereumJ library.\n *\n * The ethereumJ library i"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/ethereum/solidity/SolidityType.java",
    "chars": 15751,
    "preview": "/*\n * Copyright (c) [2016] [ <ether.camp> ]\n * This file is part of the ethereumJ library.\n *\n * The ethereumJ library i"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/ethereum/utils/ByteUtil.java",
    "chars": 22867,
    "preview": "/*\n * Copyright (c) [2016] [ <ether.camp> ]\n * This file is part of the ethereumJ library.\n *\n * The ethereumJ library i"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/ethereum/utils/FastByteComparisons.java",
    "chars": 4908,
    "preview": "/*\n * Copyright (c) [2016] [ <ether.camp> ]\n * This file is part of the ethereumJ library.\n *\n * The ethereumJ library i"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/ethereum/vm/DataWord.java",
    "chars": 11918,
    "preview": "/*\n * Copyright (c) [2016] [ <ether.camp> ]\n * This file is part of the ethereumJ library.\n *\n * The ethereumJ library i"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/ethereum/vm/LogInfo.java",
    "chars": 4189,
    "preview": "/*\n * Copyright (c) [2016] [ <ether.camp> ]\n * This file is part of the ethereumJ library.\n *\n * The ethereumJ library i"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/exception/CoinNotFindException.java",
    "chars": 219,
    "preview": "package com.quincysx.crypto.exception;\n\n/**\n * Created by q7728 on 2018/3/18.\n */\n\npublic class CoinNotFindException ext"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/exception/NonSupportException.java",
    "chars": 217,
    "preview": "package com.quincysx.crypto.exception;\n\n/**\n * Created by q7728 on 2018/3/18.\n */\n\npublic class NonSupportException exte"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/utils/BTCUtils.java",
    "chars": 2805,
    "preview": "package com.quincysx.crypto.utils;\n\nimport com.quincysx.crypto.bitcoin.BTCTransaction;\n\nimport org.spongycastle.asn1.ASN"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/utils/Base58.java",
    "chars": 4656,
    "preview": "package com.quincysx.crypto.utils;\n\nimport java.math.BigInteger;\n\n/**\n * @author QuincySx\n * @date 2018/3/1 下午5:04\n */\np"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/utils/Base58Check.java",
    "chars": 4068,
    "preview": "/* \n * Bitcoin cryptography library\n * Copyright (c) Project Nayuki\n * \n * https://www.nayuki.io/page/bitcoin-cryptograp"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/utils/Base64.java",
    "chars": 578,
    "preview": "package com.quincysx.crypto.utils;\n\nimport org.spongycastle.util.Strings;\n\nimport java.math.BigInteger;\n\n/**\n * @author "
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/utils/HexUtils.java",
    "chars": 1662,
    "preview": "package com.quincysx.crypto.utils;\n\n/**\n * @author QuincySx\n * @date 2018/3/1 下午5:17\n */\npublic final class HexUtils {\n "
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/utils/HmacSha512.java",
    "chars": 1923,
    "preview": "/*\n *  BIP32 library, a Java implementation of BIP32\n *  Copyright (C) 2017 Alan Evans, NovaCrypto\n *\n *  This program i"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/utils/KECCAK256.java",
    "chars": 696,
    "preview": "package com.quincysx.crypto.utils;\n\nimport org.spongycastle.crypto.digests.KeccakDigest;\n\n/**\n * @author QuincySx\n * @da"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/utils/RIPEMD160.java",
    "chars": 794,
    "preview": "package com.quincysx.crypto.utils;\n\nimport org.spongycastle.crypto.digests.RIPEMD160Digest;\nimport org.spongycastle.cryp"
  },
  {
    "path": "library/src/main/java/com/quincysx/crypto/utils/SHA256.java",
    "chars": 1164,
    "preview": "package com.quincysx.crypto.utils;\n\nimport android.util.Log;\n\nimport org.spongycastle.crypto.digests.SHA256Digest;\n\nimpo"
  },
  {
    "path": "library/src/main/res/values/strings.xml",
    "chars": 70,
    "preview": "<resources>\n    <string name=\"app_name\">Library</string>\n</resources>\n"
  },
  {
    "path": "library/src/test/java/com/quincysx/crypto/Bip32UnitTest.java",
    "chars": 577,
    "preview": "package com.quincysx.crypto;\n\nimport com.quincysx.crypto.bip39.MnemonicGenerator;\nimport com.quincysx.crypto.bip39.SeedC"
  },
  {
    "path": "library/src/test/java/com/quincysx/crypto/Bip39UnitTest.java",
    "chars": 3201,
    "preview": "package com.quincysx.crypto;\n\nimport com.quincysx.crypto.bip39.MnemonicGenerator;\nimport com.quincysx.crypto.bip39.Mnemo"
  },
  {
    "path": "library/src/test/java/com/quincysx/crypto/Bip44UnitTest.java",
    "chars": 288,
    "preview": "package com.quincysx.crypto;\n\nimport org.junit.Test;\n\nimport static org.junit.Assert.assertEquals;\n\n/**\n * @author Quinc"
  },
  {
    "path": "library/src/test/java/com/quincysx/crypto/Eip55UnitTest.java",
    "chars": 1733,
    "preview": "package com.quincysx.crypto;\n\nimport android.util.Log;\n\nimport com.quincysx.crypto.eip55.EthCheckAddress;\n\nimport org.ju"
  },
  {
    "path": "library/src/test/java/com/quincysx/crypto/ExampleUnitTest.java",
    "chars": 705,
    "preview": "package com.quincysx.crypto;\n\nimport com.quincysx.crypto.utils.Base64;\nimport com.quincysx.crypto.utils.HexUtils;\n\nimpor"
  },
  {
    "path": "library/src/test/java/com/quincysx/crypto/HashUnitTest.java",
    "chars": 2513,
    "preview": "package com.quincysx.crypto;\n\nimport com.quincysx.crypto.utils.Base64;\nimport com.quincysx.crypto.utils.HexUtils;\nimport"
  },
  {
    "path": "sample/.gitignore",
    "chars": 7,
    "preview": "/build\n"
  },
  {
    "path": "sample/build.gradle",
    "chars": 971,
    "preview": "apply plugin: 'com.android.application'\n\nandroid {\n    compileSdkVersion 27\n    defaultConfig {\n        applicationId \"c"
  },
  {
    "path": "sample/proguard-rules.pro",
    "chars": 751,
    "preview": "# Add project specific ProGuard rules here.\n# You can control the set of applied configuration files using the\n# proguar"
  },
  {
    "path": "sample/src/androidTest/java/com/quincysx/crypto/ExampleInstrumentedTest.java",
    "chars": 739,
    "preview": "package com.quincysx.crypto;\n\nimport android.content.Context;\nimport android.support.test.InstrumentationRegistry;\nimpor"
  },
  {
    "path": "sample/src/main/AndroidManifest.xml",
    "chars": 993,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package="
  },
  {
    "path": "sample/src/main/java/com/quincysx/crypto/smpale/Main1Activity.java",
    "chars": 3042,
    "preview": "package com.quincysx.crypto.smpale;\n\nimport android.os.Bundle;\nimport android.support.v7.app.AppCompatActivity;\nimport a"
  },
  {
    "path": "sample/src/main/java/com/quincysx/crypto/smpale/MainActivity.java",
    "chars": 11917,
    "preview": "package com.quincysx.crypto.smpale;\n\nimport android.os.Bundle;\nimport android.support.v7.app.AppCompatActivity;\nimport a"
  },
  {
    "path": "sample/src/main/res/drawable/ic_launcher_background.xml",
    "chars": 5606,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:wi"
  },
  {
    "path": "sample/src/main/res/drawable-v24/ic_launcher_foreground.xml",
    "chars": 1880,
    "preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:aapt=\"http://schemas.android.com/aapt\"\n    "
  },
  {
    "path": "sample/src/main/res/layout/activity_main.xml",
    "chars": 795,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<android.support.constraint.ConstraintLayout xmlns:android=\"http://schemas.androi"
  },
  {
    "path": "sample/src/main/res/mipmap-anydpi-v26/ic_launcher.xml",
    "chars": 272,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<adaptive-icon xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <b"
  },
  {
    "path": "sample/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml",
    "chars": 272,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<adaptive-icon xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <b"
  },
  {
    "path": "sample/src/main/res/values/colors.xml",
    "chars": 208,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <color name=\"colorPrimary\">#3F51B5</color>\n    <color name=\"color"
  },
  {
    "path": "sample/src/main/res/values/strings.xml",
    "chars": 73,
    "preview": "<resources>\n    <string name=\"app_name\">CryptoDemo</string>\n</resources>\n"
  },
  {
    "path": "sample/src/main/res/values/styles.xml",
    "chars": 383,
    "preview": "<resources>\n\n    <!-- Base application theme. -->\n    <style name=\"AppTheme\" parent=\"Theme.AppCompat.Light.DarkActionBar"
  },
  {
    "path": "sample/src/test/java/com/quincysx/crypto/ExampleUnitTest.java",
    "chars": 649,
    "preview": "package com.quincysx.crypto;\n\nimport com.quincysx.crypto.utils.Base64;\nimport com.quincysx.crypto.utils.HexUtils;\nimport"
  },
  {
    "path": "settings.gradle",
    "chars": 30,
    "preview": "include ':sample', ':library'\n"
  }
]

// ... and 1 more files (download for full content)

About this extraction

This page contains the full source code of the QuincySx/BlockchainWallet-Crypto GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 122 files (650.3 KB), approximately 167.5k tokens, and a symbol index with 953 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!