Skip to content

Commit

Permalink
ECB is fine with Zero and Default IV
Browse files Browse the repository at this point in the history
  • Loading branch information
5HT committed Jul 5, 2023
1 parent 5fc45b7 commit b9d8cfe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/aes_kw.erl
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ do_unwrap(<< A0:?MSB64, Rest/binary >>, J, I, BlockCount, KEK) ->
Round = (BlockCount * J) + I,
A1 = A0 bxor Round,
Data = << A1:?MSB64, B0/binary >>,
<< A2:8/binary, B1/binary >> = crypto:crypto_one_time(codec(bit_size(KEK)), KEK, <<>>, Data, [{encrypt,false}]),
<< A2:8/binary, B1/binary >> = crypto:crypto_one_time(codec(bit_size(KEK)), KEK, ?DEFAULT_IV, Data, [{encrypt,false}]),
do_unwrap(<< A2/binary, Head/binary, B1/binary, Tail/binary >>, J, I - 1, BlockCount, KEK).

test() ->
Expand Down

0 comments on commit b9d8cfe

Please sign in to comment.