accessing arcfour sboxes
Wed, 24 Sep 2003 00:48:18 +0200
I have an application that uses arcfour, and need to be able to
extract (and set) the (sbox, i, j) tuple. I tried to implement this
in libgcrypt, and noticed the cipher-specific _ctl functions has been
removed, so it does not seem possible to reach each low-level cipher
via gcry_cipher_ctl() any longer, which I miss. The cipher struct now
/* Module specification structure for ciphers. */
typedef struct gcry_cipher_spec
const char *name;
const char **aliases;
Where the two last entries correspond to stream en/de-cryption (btw,
why does a stream cipher need different encryption/decryption calls?).
Would it be possible to add a 'gcry_cipher_ctl_t ctl', or something,
to that struct, and in the arcfour.c define this to a function that
extract/set the (sbox, i, j)? The gcry_cipher_ctl_t function should
be modeled after gcry_cipher_ctl():
/* Perform various operations on the cipher object H. */
gcry_error_t gcry_cipher_ctl (gcry_cipher_hd_t h, int cmd, void *buffer,
So it is able to support various low-level cipher specific stuff.
What do you think of the general idea?
Is there any other way to communicate, from the application, directly
to each low-level cipher object in libgcrypt, that I missed?