diff options
Diffstat (limited to 'ext/node/polyfills/internal/crypto/pbkdf2.ts')
-rw-r--r-- | ext/node/polyfills/internal/crypto/pbkdf2.ts | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/ext/node/polyfills/internal/crypto/pbkdf2.ts b/ext/node/polyfills/internal/crypto/pbkdf2.ts index e365ef3f0..47c66043c 100644 --- a/ext/node/polyfills/internal/crypto/pbkdf2.ts +++ b/ext/node/polyfills/internal/crypto/pbkdf2.ts @@ -3,13 +3,15 @@ // TODO(petamoriken): enable prefer-primordials for node polyfills // deno-lint-ignore-file prefer-primordials +import { core } from "ext:core/mod.js"; +const { + op_node_pbkdf2, + op_node_pbkdf2_async, +} = core.ensureFastOps(); + import { Buffer } from "node:buffer"; import { HASH_DATA } from "ext:deno_node/internal/crypto/types.ts"; -const { core } = globalThis.__bootstrap; -const { ops } = core; -const { op_node_pbkdf2_async } = core.ensureFastOps(); - export const MAX_ALLOC = Math.pow(2, 30) - 1; export type NormalizedAlgorithms = @@ -51,7 +53,7 @@ export function pbkdf2Sync( } const DK = new Uint8Array(keylen); - if (!ops.op_node_pbkdf2(password, salt, iterations, digest, DK)) { + if (!op_node_pbkdf2(password, salt, iterations, digest, DK)) { throw new Error("Invalid digest"); } |