UNPKG

@auth0/cose

Version:
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;