aboutsummaryrefslogtreecommitdiff
path: root/src/node-fallbacks/crypto.js
diff options
context:
space:
mode:
authorGravatar Ciro Spaciari <ciro.spaciari@gmail.com> 2023-07-10 21:14:37 -0300
committerGravatar GitHub <noreply@github.com> 2023-07-10 17:14:37 -0700
commit4af4b508a1027ee837f69d4fed5a246629714398 (patch)
tree1e769ce87851d1416911f9c7a965b6f291a3affc /src/node-fallbacks/crypto.js
parentec1117031197dbce434473492c85bb2654a91248 (diff)
downloadbun-4af4b508a1027ee837f69d4fed5a246629714398.tar.gz
bun-4af4b508a1027ee837f69d4fed5a246629714398.tar.zst
bun-4af4b508a1027ee837f69d4fed5a246629714398.zip
feat(crypto) add getCurves (#3598)
* add getCurves * add nodefallbacks * update docs * oops
Diffstat (limited to 'src/node-fallbacks/crypto.js')
-rw-r--r--src/node-fallbacks/crypto.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/node-fallbacks/crypto.js b/src/node-fallbacks/crypto.js
index 7745530da..65ae2f5b3 100644
--- a/src/node-fallbacks/crypto.js
+++ b/src/node-fallbacks/crypto.js
@@ -12,6 +12,27 @@ export const randomUUID = () => {
return crypto.randomUUID();
};
+const harcoded_curves = [
+ "p192",
+ "p224",
+ "p256",
+ "p384",
+ "p521",
+ "curve25519",
+ "ed25519",
+ "secp256k1",
+ "secp224r1",
+ "prime256v1",
+ "prime192v1",
+ "ed25519",
+ "secp384r1",
+ "secp521r1",
+];
+
+export function getCurves() {
+ return harcoded_curves;
+}
+
export const timingSafeEqual =
"timingSafeEqual" in crypto
? (a, b) => {
@@ -89,4 +110,5 @@ export default {
scryptSync,
scrypt,
webcrypto,
+ getCurves,
};