From df913fd77fe396f022e5d887ebf5aa359c366939 Mon Sep 17 00:00:00 2001 From: "Rudy B." Date: Sat, 25 Apr 2026 16:13:21 +0200 Subject: [PATCH] chore: remove unnecessary function --- src/lib/two-factor/crypto.ts | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/lib/two-factor/crypto.ts b/src/lib/two-factor/crypto.ts index 009109e77..cc0cca056 100644 --- a/src/lib/two-factor/crypto.ts +++ b/src/lib/two-factor/crypto.ts @@ -1,4 +1,4 @@ -import { createCipheriv, createDecipheriv, randomBytes, timingSafeEqual } from 'crypto'; +import { createCipheriv, createDecipheriv, randomBytes } from 'crypto'; const ALGORITHM = 'aes-256-gcm'; @@ -31,9 +31,3 @@ export function decryptSecret(stored: string): string { ]); return decrypted.toString('utf8'); } - -/** Compares two strings in constant time to prevent timing attacks. */ -export function constantTimeEqual(a: string, b: string): boolean { - if (a.length !== b.length) return false; - return timingSafeEqual(Buffer.from(a), Buffer.from(b)); -}