Skip to main content
Module

x/jose/lib/check_iv_length.ts

"JSON Web Almost Everything" - JWA, JWS, JWE, JWT, JWK, JWKS for Node.js, Browser, Cloudflare Workers, Deno, Bun, and other Web-interoperable runtimes.
Extremely Popular
Go to Latest
File
import { JWEInvalid } from '../util/errors.ts'import { bitLength } from './iv.ts'
const checkIvLength = (enc: string, iv: Uint8Array) => { if (iv.length << 3 !== bitLength(enc)) { throw new JWEInvalid('Invalid Initialization Vector length') }}
export default checkIvLength