Thread (4 messages) 4 messages, 2 authors, 2007-08-17

Re: can CTR use blkcipher_walk_virt()?

From: Joy Latten <hidden>
Date: 2007-08-17 19:57:38

On Fri, 2007-08-17 at 10:19 +0800, Herbert Xu wrote:
Joy Latten [off-list ref] wrote:
quoted
I am in learning mode and have been looking into CTR.
Based on the fact that CTR does not require the plaintext to 
be a multiple of the blocksize nor is padding required,
should I use cipher.c routines (as xcbc does) instead
of blkcipher.c routines (as cbc does)?
(I've been referencing rfc 3686.)
CBC is the correct model to follow.  For our purposes you
will only get multiples of blocks.  The only difference
is that unlike CBC you can chop bits off the last block
of plain text and the same bits will be chopped off in
the cipher text.
ok, that is good, I started out following CBC model and will continue. 

Just to make sure I understand correctly, 
our plaintext will be a multiple of the blocksize,
therefore it may be padded, right? 
Also, since it is a multiple, I don't have to worry about last
block of plaintext being less than blocksize and truncating 
the keystream or ciphertext, right?


Thanks.

Joy


With CBC chopping off bits in either changes the other one
entirely.

Cheers,
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help