Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cloudflare): update crypto hybrid polyfill #310

Merged
merged 1 commit into from
Sep 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions src/runtime/node/crypto/$cloudflare.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import type nodeCrypto from "node:crypto";

export {
Certificate,
Cipher,
Cipheriv,
Decipher,
Decipheriv,
ECDH,
Sign,
Verify,
X509Certificate,
constants,
createCipheriv,
createDecipheriv,
Expand All @@ -23,22 +21,18 @@ export {
privateEncrypt,
publicDecrypt,
publicEncrypt,
scrypt,
scryptSync,
sign,
verify,
} from "./index";

import {
Certificate,
Cipher,
Cipheriv,
Decipher,
Decipheriv,
ECDH,
Sign,
Verify,
X509Certificate,
constants,
createCipheriv,
createDecipheriv,
Expand All @@ -52,8 +46,6 @@ import {
privateEncrypt,
publicDecrypt,
publicEncrypt,
scrypt,
scryptSync,
sign,
verify,
webcrypto as unenvCryptoWebcrypto,
Expand All @@ -64,11 +56,13 @@ const workerdCrypto = process.getBuiltinModule("node:crypto");
// TODO: Ideally this list is not hardcoded but instead is generated when the preset is being generated in the `env()` call
// This generation should use information from https://github.com/cloudflare/workerd/issues/2097
export const {
Certificate,
DiffieHellman,
DiffieHellmanGroup,
Hash,
Hmac,
KeyObject,
X509Certificate,
checkPrime,
checkPrimeSync,
createDiffieHellman,
Expand Down Expand Up @@ -98,6 +92,8 @@ export const {
randomFillSync,
randomInt,
randomUUID,
scrypt,
scryptSync,
secureHeapUsed,
setEngine,
setFips,
Expand Down