UNPKG

cose-kit

Version:

**DEPRECATED:** Use [@auth0/cose](https://www.npmjs.com/package/@auth0/cose).

9 lines (8 loc) 296 B
import { COSEEncryptedInvalid } from '../util/errors.js'; import { bitLength } from './iv.js'; const checkIvLength = (enc, iv) => { if (iv.length << 3 !== bitLength(enc)) { throw new COSEEncryptedInvalid('Invalid Initialization Vector length'); } }; export default checkIvLength;