Skip to content

Commit

Permalink
fix default iv
Browse files Browse the repository at this point in the history
  • Loading branch information
5HT committed Aug 15, 2023
1 parent 9d98203 commit ca4dd55
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion priv/cms/clean.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/sh

rm *.asn1db *.beam *.erl *.hrl
rm *.asn1db *.beam *.erl *.hrl *.c *.h *.json *_files
2 changes: 1 addition & 1 deletion src/aes_kw.erl
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ do_wrap(<< A0:8/binary, Rest/binary >>, J, I, BlockCount, KEK) ->
<< Head:HeadSize/binary, B0:8/binary, Tail/binary >> = Rest,
Round = (BlockCount * J) + I,
Data = << A0/binary, B0/binary >>,
<< A1:?MSB64, B1/binary >> = crypto:crypto_one_time(codec(bit_size(KEK)), KEK, <<>>, Data, [{encrypt,true}]),
<< A1:?MSB64, B1/binary >> = crypto:crypto_one_time(codec(bit_size(KEK)), KEK, ?DEFAULT_IV, Data, [{encrypt,true}]),
A2 = A1 bxor Round,
do_wrap(<< A2:?MSB64, Head/binary, B1/binary, Tail/binary >>, J, I + 1, BlockCount, KEK).

Expand Down

0 comments on commit ca4dd55

Please sign in to comment.