Calculate number of blocks from length in CTR mode

This commit is contained in:
Raymond Pasco 2016-08-15 14:00:23 -04:00
parent 4ab5a2d411
commit b5dca87907

View File

@ -436,7 +436,7 @@
|= txt/@
^- @ux
=/ encrypt ~(en ecba key)
=/ blocks (met 7 txt)
=/ blocks (add (div len 16) ?:(=((mod len 16) 0) 0 1))
=. blocks ?:(=(0 blocks) 1 blocks)
?> (gte len (met 3 txt))
%+ mix txt
@ -458,7 +458,7 @@
|= txt/@
^- @ux
=/ encrypt ~(en ecbb key)
=/ blocks (met 7 txt)
=/ blocks (add (div len 16) ?:(=((mod len 16) 0) 0 1))
=. blocks ?:(=(0 blocks) 1 blocks)
?> (gte len (met 3 txt))
%+ mix txt
@ -480,7 +480,7 @@
|= txt/@
^- @ux
=/ encrypt ~(en ecbc key)
=/ blocks (met 7 txt)
=/ blocks (add (div len 16) ?:(=((mod len 16) 0) 0 1))
=. blocks ?:(=(0 blocks) 1 blocks)
?> (gte len (met 3 txt))
%+ mix txt