Re: aes decrypt encrypt
- From: Mike Amling <nospam@xxxxxxxxxx>
- Date: Thu, 26 Apr 2007 16:00:01 -0500
Sebastian G. wrote:
Mike Amling wrote:
Kristian Gjøsteen wrote:e704112@xxxxxxxxx <e704112@xxxxxxxxx> wrote:i don' t get back my plaintext, just some weird character.What if you specify a 16-byte key?
That's an error, but probably not causing the symptom. My understanding is that a standard C compiler must initialize the 8 unspecified bytes of the key array to binary zero bytes.
You should doubt your understanding and rather read the spec. The C compiler is not required to initialize any variable.
From C99:
"If there are fewer initializers in a brace-enclosed list than there are elements or members of an aggregate, or fewer characters in a string literal used to initialize an array of known size than there are elements in the array, the remainder of the aggregate shall be initialized implicitly the same as objects that have static storage duration."
which in the OP's code means the key bytes at subscripts [8..16] become binary zero.
--Mike Amling
.
- References:
- aes decrypt encrypt
- From: e704112@xxxxxxxxx
- Re: aes decrypt encrypt
- From: Kristian Gjøsteen
- Re: aes decrypt encrypt
- From: Mike Amling
- Re: aes decrypt encrypt
- From: Sebastian G.
- aes decrypt encrypt
- Prev by Date: Re: Error on "cryptorati.com" - adacrypt
- Next by Date: Re: interesting article on quantum cryptography
- Previous by thread: Re: aes decrypt encrypt
- Next by thread: Re: aes decrypt encrypt
- Index(es):
Relevant Pages
|