From b5dca87907aadeb1adb7e5bf3063bbde02b2acae Mon Sep 17 00:00:00 2001 From: Raymond Pasco Date: Mon, 15 Aug 2016 14:00:23 -0400 Subject: [PATCH] Calculate number of blocks from length in CTR mode --- arvo/zuse.hoon | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arvo/zuse.hoon b/arvo/zuse.hoon index 3e82bcfd3..fa5c85342 100644 --- a/arvo/zuse.hoon +++ b/arvo/zuse.hoon @@ -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