Mailing List Archive

Figuring out if a cipher mode is available.
I'm trying to use OFB mode with AES and also with DES. The call:
gcry_cipher_open( &context, GCRY_CIPHER_AES128, GCRY_CIPHER_MODE_OFB, 0 );
fails (works for GCRY_CIPHER_MODE_ECB, _CFB and _CBC).

I see in the code that not all modes are supported for all Ciphers, which is
fair enough.
That is a problem for me - I can deal with not having OFB support, but I need
to know earlier. Is there a list of Cipher / mode combinations, or is there
some call I can use to test for support?

Brad
Re: Figuring out if a cipher mode is available. [ In reply to ]
On Mon, Mar 28, 2005 at 05:49:15PM +1100, Brad Hards wrote:

> I see in the code that not all modes are supported for all Ciphers,
> which is fair enough.

Well, yes. There are the modes ECB, CBC, CFB and CTR for block
ciphers and there is STREAM for stream ciphers; OFB is not supported
for any algorithm currently.

> That is a problem for me - I can deal with not having OFB support, but I need
> to know earlier.

As I said, there is no OFB support currently - but there is already an
according constant defined, though.

> Is there a list of Cipher / mode combinations, or is there some call
> I can use to test for support?

No, but I agree that this might be useful; I will think about it.

Thanks,
Moritz

--
Moritz Schulte
Re: Figuring out if a cipher mode is available. [ In reply to ]
On Mon, 28 Mar 2005 19:22 pm, Moritz Schulte wrote:
> > I see in the code that not all modes are supported for all Ciphers,
> > which is fair enough.
>
> Well, yes.  There are the modes ECB, CBC, CFB and CTR for block
> ciphers and there is STREAM for stream ciphers; OFB is not supported
> for any algorithm currently.
Are those modes good for all ciphers?

Brad
Re: Figuring out if a cipher mode is available. [ In reply to ]
On Mon, Mar 28, 2005 at 08:43:49PM +1100, Brad Hards wrote:

> Are those modes good for all ciphers?

Yes. Block ciphers are seperate from their modes of operation, thus
you can combine them in any way you like.

Moritz

--
Moritz Schulte