Re: AES_128 in RFC 4493
- From: "Blind Anagram" <nobody@xxxxxxxxxxx>
- Date: Sat, 20 Sep 2008 15:28:24 +0100
"karthikbalaguru" <karthikbalaguru79@xxxxxxxxx> wrote in message news:841b5405-7fa1-4cee-812b-bce510f4f411@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Sep 20, 4:05 pm, "Blind Anagram" <nob...@xxxxxxxxxxx> wrote:
"karthikbalaguru" <karthikbalagur...@xxxxxxxxx> wrote in message
news:08455d0b-b346-42fb-8dbb-8ee3a8de76eb@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> Hi,
> In the RFC 4493, i find the source code in C language for AEC CMAC
> algorithm.
> I find that there is an API called as AES_128 . But, there is no
> definition for that API :( :(
> Can anyone give me a definition for the AES_128 API that is being
> used in the RFC 4493.
> Is there any link for the definition of AES_128 ?
> Below is an extract from RFC 4493 for your reference :-
> " printf("\nSubkey Generation\n");
> AES_128(key,const_Zero,L);
> printf("AES_128(key,0) "); print128(L); printf("\n");
> "
This line with a comment later in the code:
AES_128(key,Y,X); /* X := AES-128(KEY, Y); */
suggests that AES_128(key,Y,X) encrypts the 16 byte block Y into the 16 byte
block X using the 16 byte key 'key'.
Thx for your reply. Yes, i understand that meaning.
But, my query is to find the source code(definition) for
AES_128 API so that i can use it in the AEC-CMAC ?
In RFC 4493, AES_CMAC algorithm uses AES_128 api, but
i am unable to find the source code for AES_128 in the RFC 4493.
So, if you try to use the source code , it will show
compilation failure as the definition of AES_128 is absent.
How to resolve the error ?
Where can i get the source code for the AES_128 api ?
Is it defined in some other document related to RFC 4493 ?
Below is an extract from RFC 4493 for your reference :-
" for ( i=0; i<16; i++ ) X[i] = 0;
for ( i=0; i<n-1; i++ ) {
xor_128(X,&input[16*i],Y); /* Y := Mi (+) X */
AES_128(key,Y,X); /* X := AES-128(KEY, Y); */
}
xor_128(X,M_last,Y);
AES_128(key,Y,X);
for ( i=0; i<16; i++ ) {
mac[i] = X[i];
}
"
The call AES_128(k, in, out) is pseudo code for AES - if you want to use the RFC code you will have to find an AES implementation and build an API around it to match the RFC 4493.
If you aren't worried about speed, you could use my own byte oriented version of AES at:
http://fp.gladman.plus.com/AES/aes-byte-29-08-08.zip
If you set this for 'on the fly keying' it offers the API call:
void aes_encrypt_128( const unsigned char in[16],
unsigned char out[16],
const unsigned char key[16],
uint_8t o_key[16] );
which will be easy to convert to the form in RFC 4493 (you won't need o_key so you can just define an unused 16 byte array for this)
BUT this will be very slow comapred to normal AES code.
However I think if you search around you might find an AES implementation with an interface close to that used in the RFC.
To use pre-keyed code you would need to define AES_128(k,Y,X) using something like:
#define AES_128(k,y,x) \
{ aes_encrypt_ctx cx[1]; \
aes_encrypt_key128( k, cx); \
aes_encrypt( y, x, cx); \
}
.
- References:
- AES_128 in RFC 4493
- From: karthikbalaguru
- Re: AES_128 in RFC 4493
- From: Blind Anagram
- Re: AES_128 in RFC 4493
- From: karthikbalaguru
- AES_128 in RFC 4493
- Prev by Date: When a Function is truly One-Way.
- Next by Date: Re: Conventional DES byte order?
- Previous by thread: Re: AES_128 in RFC 4493
- Next by thread: When a Function is truly One-Way.
- Index(es):
Relevant Pages
|