Make encrypt service decrypt faster by not doing constant time equal
This commit is contained in:
parent
5906a36335
commit
6ed3fdfa4d
|
@ -92,7 +92,8 @@ export class EncryptServiceImplementation implements EncryptService {
|
|||
fastParams.macKey,
|
||||
"sha256",
|
||||
);
|
||||
const macsEqual = await this.cryptoFunctionService.compareFast(fastParams.mac, computedMac);
|
||||
/// no constant time comparison, because there is no backchannel for timing attacks
|
||||
const macsEqual = fastParams.mac === computedMac;
|
||||
if (!macsEqual) {
|
||||
this.logMacFailed("mac failed.");
|
||||
return null;
|
||||
|
|
Loading…
Reference in New Issue