Skip to content

Commit 9205ade

Browse files
authored
docs: add references about why we use crypto.timingSafeEqual (#525)
1 parent 01c38e8 commit 9205ade

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/verify/index.ts

+3
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,8 @@ export function verify(
2828
return false;
2929
}
3030

31+
// constant time comparison to prevent timing attachs
32+
// https://stackoverflow.com/a/31096242/206879
33+
// https://en.wikipedia.org/wiki/Timing_attack
3134
return timingSafeEqual(signatureBuffer, verificationBuffer);
3235
}

0 commit comments

Comments
 (0)