UNPKG
@authing/jose
Version:
beta (1.0.2-beta.4)
latest (1.0.2-beta)
1.0.5
1.0.4
1.0.3
1.0.2
1.0.2-beta.4
1.0.2-beta.2
1.0.2-beta
1.0.1
1.0.0
Webpack v4 compatible version of panva/jose v3.x
@authing/jose
/
dist
/
browser
/
lib
/
check_iv_length.js
9 lines
(8 loc)
•
282 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
import
{
JWEInvalid
}
from
'../util/errors.js'
;
import
{ bitLengths }
from
'./iv.js'
;
const
checkIvLength
= (
enc, iv
) => {
if
(iv.
length
<<
3
!== bitLengths.
get
(enc)) {
throw
new
JWEInvalid
(
'Invalid Initialization Vector length'
); } };
export
default
checkIvLength;