On Sun, Jul 09, 2006 at 02:53:29PM -0500, Matthew R. Dempsky wrote:
> > as they pretty well can encrypt per byte according to applied cryptography
> > from
> > schneier.
>
> What about CTR? OpenBSD can do AES-CTR.
Oh wow my applied cryptography second edition is getting old. ;) There is no
mention of CTR mode in it, I had to look it up online. I think it may work
that way.
I found the functions for aes_ctr_crypt() et al. in /sys/crypto/xform.c:
xform.c:int aes_ctr_setkey(u_int8_t **, u_int8_t *, int);
xform.c:void aes_ctr_zerokey(u_int8_t **);
xform.c:void aes_ctr_reinit(caddr_t, u_int8_t *);
xform.c:void aes_ctr_crypt(caddr_t, u_int8_t *);
xform.c: aes_ctr_crypt,
As I'm unfamiliar with this function, perhaps someone experienced can explain
how this works. I read the code briefly for aes_ctr_crypt() and noticed it
does manipulate AESCTR_BLOCKSIZE (16) bytes on the second argument, how do I
make it work for just 1 byte streaming, I suppose I must make sure I pass it
such many bytes.. are the remaining 15 bytes just padding that I can throw
away?
I'm talking about this:
for (i = 0; i < AESCTR_BLOCKSIZE; i++)
data[i] ^= keystream[i];
Why is there a AESCTR_BLOCKSIZE? Pardon my ignorance on this cipher, cipher
mode and implementation in OpenBSD's kernel. Any provided "official" stream
cipher would beat a simple XOR.
regards,
-peter
--
Here my ticker tape .signature #### My name is Peter Philipp #### lynx -dump
"http://en.wikipedia.org/w/index.php?title=Pufferfish&oldid=20768394" | sed -n
131,136p #### So long and thanks for all the fish!!!