index.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. /**
  2. * A fundamental building block of Ethereum is the underlying
  3. * cryptographic primitives.
  4. *
  5. * @_section: api/crypto:Cryptographic Functions [about-crypto]
  6. */
  7. null;
  8. // We import all these so we can export lock()
  9. import { computeHmac } from "./hmac.js";
  10. import { keccak256 } from "./keccak.js";
  11. import { ripemd160 } from "./ripemd160.js";
  12. import { pbkdf2 } from "./pbkdf2.js";
  13. import { randomBytes } from "./random.js";
  14. import { scrypt, scryptSync } from "./scrypt.js";
  15. import { sha256, sha512 } from "./sha2.js";
  16. export { computeHmac, randomBytes, keccak256, ripemd160, sha256, sha512, pbkdf2, scrypt, scryptSync };
  17. export { SigningKey } from "./signing-key.js";
  18. export { Signature } from "./signature.js";
  19. /**
  20. * Once called, prevents any future change to the underlying cryptographic
  21. * primitives using the ``.register`` feature for hooks.
  22. */
  23. function lock() {
  24. computeHmac.lock();
  25. keccak256.lock();
  26. pbkdf2.lock();
  27. randomBytes.lock();
  28. ripemd160.lock();
  29. scrypt.lock();
  30. scryptSync.lock();
  31. sha256.lock();
  32. sha512.lock();
  33. randomBytes.lock();
  34. }
  35. export { lock };
  36. //# sourceMappingURL=index.js.map