mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-17 11:51:32 +03:00
Calculate number of blocks from length in CTR mode
This commit is contained in:
parent
4ab5a2d411
commit
b5dca87907
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user