2022-11-28 05:53:06 +03:00
|
|
|
/**
|
2022-12-03 05:23:13 +03:00
|
|
|
* A fundamental building block of Ethereum is the underlying
|
|
|
|
* cryptographic primitives.
|
2022-11-28 05:53:06 +03:00
|
|
|
*
|
2023-02-13 05:21:11 +03:00
|
|
|
* @_section: api/crypto:Cryptographic Functions [about-crypto]
|
2022-11-28 05:53:06 +03:00
|
|
|
*/
|
|
|
|
|
2022-12-03 05:23:13 +03:00
|
|
|
null
|
|
|
|
|
2022-09-05 23:14:43 +03:00
|
|
|
// We import all these so we can export lock()
|
|
|
|
import { computeHmac } from "./hmac.js";
|
|
|
|
import { keccak256 } from "./keccak.js";
|
|
|
|
import { ripemd160 } from "./ripemd160.js";
|
|
|
|
import { pbkdf2 } from "./pbkdf2.js";
|
|
|
|
import { randomBytes } from "./random.js";
|
|
|
|
import { scrypt, scryptSync } from "./scrypt.js";
|
|
|
|
import { sha256, sha512 } from "./sha2.js";
|
|
|
|
|
|
|
|
export {
|
|
|
|
computeHmac,
|
|
|
|
|
|
|
|
randomBytes,
|
|
|
|
|
|
|
|
keccak256,
|
|
|
|
ripemd160,
|
|
|
|
sha256, sha512,
|
|
|
|
|
|
|
|
pbkdf2,
|
|
|
|
scrypt, scryptSync
|
|
|
|
};
|
|
|
|
|
|
|
|
export { SigningKey } from "./signing-key.js";
|
|
|
|
export { Signature } from "./signature.js";
|
|
|
|
|
|
|
|
function lock(): void {
|
|
|
|
computeHmac.lock();
|
|
|
|
keccak256.lock();
|
|
|
|
pbkdf2.lock();
|
|
|
|
randomBytes.lock();
|
|
|
|
ripemd160.lock();
|
|
|
|
scrypt.lock();
|
|
|
|
scryptSync.lock();
|
|
|
|
sha256.lock();
|
|
|
|
sha512.lock();
|
2022-10-01 02:56:13 +03:00
|
|
|
randomBytes.lock();
|
2022-09-05 23:14:43 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
export { lock };
|
|
|
|
|
|
|
|
/////////////////////////////
|
|
|
|
// Types
|
|
|
|
|
|
|
|
export type { ProgressCallback } from "./scrypt.js";
|
|
|
|
|
|
|
|
export type { SignatureLike } from "./signature.js";
|