Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Update lisk-cryptography to only export public intended functions #6710

Closed
Tracked by #7210
shuse2 opened this issue Sep 2, 2021 · 0 comments · Fixed by #7310
Closed
Tracked by #7210

Update lisk-cryptography to only export public intended functions #6710

shuse2 opened this issue Sep 2, 2021 · 0 comments · Fixed by #7310

Comments

@shuse2
Copy link
Collaborator

shuse2 commented Sep 2, 2021

Description

lisk-cryptography should only export function which is intended.

Exported functions

bls: {
  signData (sign),
  verifyData (verify),
  createAggSig,
  verifyAggSig,
  verifyWeightedAggSig,
  generatePrivateKey,
  getPublicKeyFromPrivateKey,
  validateKey,
  getPrivateKeyFromPhraseAndPath,
  popProve (blsPopProve),
  popVerify (blsPopVerify),
},
ed: {
  getPublicKeyFromPrivateKey (getPublicKey),
  getPrivateKeyFromPhraseAndPath (getKeyPairFromPhraseAndPath),
  signMessageWithPassphrase,
  verifyMessageWithPublicKey,
  printSignedMessage,
  signAndPrintMessage,
  signDataWithPrivateKey,
  signDataWithPassphrase,
  signData,
  verifyData,
  getPrivateAndPublicKeyFromPassphrase,
  getKeys,
  getKeyPair,
},
address: {
  getAddressFromPublicKey,
  getAddressAndPublicKeyFromPassphrase,
  getAddressFromPassphrase,
  getAddressFromPrivateKey,
  addressToLisk32, (Consider moving to codec)
  getLisk32AddressFromPublicKey,
  getLisk32AddressFromPassphrase,
  validateLisk32Address,
  getAddressFromLisk32Address,
  getLisk32AddressFromAddress,
},
encrypt: {
  encryptAES256GCMWithPassword,
  decryptAES256GCMWithPassword,
  encryptMessageWithPassphrase,
  decryptMessageWithPassphrase,
  encryptPassphraseWithPassword,
  decryptPassphraseWithPassword,
  stringifyEncryptedMessage (stringifyEncryptedPassphrase),
  parseEncryptedPassphrase (parseEncryptedPassphrase),
},
utils: {
  hash,
  getNetworkIdentifier,
  generateHashOnionSeed,
  hashOnion,
  intToBuffer,
  getRandomBytes,
  createMessageTag,
  tagMessage,
},

Acceptance Criteria

  • Update the source and test structure according to the above structure
  • Functions which are not listed above should not be exported
  • Update all tests and builds
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants