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)); -}