diff --git a/src/mechs/hmac/hmac.ts b/src/mechs/hmac/hmac.ts index 40de998..f2267cd 100644 --- a/src/mechs/hmac/hmac.ts +++ b/src/mechs/hmac/hmac.ts @@ -7,7 +7,7 @@ import { HmacCryptoKey } from "./key"; export class HmacProvider extends core.HmacProvider { public async onGenerateKey(algorithm: HmacKeyGenParams, extractable: boolean, keyUsages: KeyUsage[]): Promise { - const length = algorithm.length || this.getDefaultLength((algorithm.hash as Algorithm).name); + const length = (algorithm.length || this.getDefaultLength((algorithm.hash as Algorithm).name)) >> 3 << 3; const key = new HmacCryptoKey(); key.algorithm = { ...algorithm as any,