Skip to content

Conversation

rg911
Copy link
Contributor

@rg911 rg911 commented Jun 26, 2019

  • Introduced the SignSchema to make KeyPair generation consistent between Catapult and NIS.
  • SignSchema contain 2 enum value: KECCAK_REVERSED_KEY and SHA3. The SDK by default uses SHA3 which is the Catapult signature schema.

Concept

Since Catapult server is using 'SHA3' as default hasher while NIS1 (current public net) is Keccak based. This change will allow Catapult SDK to be compatible to NIS1's hashes e.g. KeyPair, Address, Encryption, Decryption etc..

By default, the SDK uses SignSchema.SHA3 for hashing unless explicitly specified KECCAK_REVERSED_KEY.

  • Affected classes:
  1. KeyPair
    • createKeyPairFromPrivateKeyString
    • sign
    • verify
    • deriveSharedKey
  2. Crypto
    • encode
    • decode
  3. Account
  4. Address
    • createFromPublicKey
  5. PublicAccount
    • createFromPublicKey
    • verifySignature
  6. All transaction signings

@coveralls
Copy link

coveralls commented Jun 26, 2019

Pull Request Test Coverage Report for Build 554

  • 127 of 131 (96.95%) changed or added relevant lines in 18 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.4%) to 60.677%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/core/crypto/KeyPair.ts 17 18 94.44%
src/infrastructure/builders/AggregateTransaction.ts 3 4 75.0%
src/core/crypto/nacl_catapult.ts 38 40 95.0%
Totals Coverage Status
Change from base Build 549: 0.4%
Covered Lines: 5900
Relevant Lines: 8405

💛 - Coveralls

@rg911 rg911 changed the title Issue #189 Added SignSchema [Elephant] Issue #189 Added SignSchema Jul 3, 2019
@rg911 rg911 deleted the task/g189_Keccak_KeyPair_Key_Derive branch July 8, 2019 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants