-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added aestest.c to check the aesni invocation matches the sw version
- Loading branch information
1 parent
c7a53aa
commit 87d1843
Showing
4 changed files
with
105 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
|
||
#include <stdio.h> | ||
|
||
extern void aesni128k128d(unsigned char *key, unsigned char *data, unsigned char *ciphertext); | ||
extern void aessw128k128d(unsigned char *key, unsigned char *data, unsigned char *ciphertext); | ||
|
||
int aesni_supported; | ||
|
||
void printsample(unsigned char *thesample) | ||
{ | ||
int tempindex; | ||
int j; | ||
int i; | ||
tempindex = 0; | ||
for (i=0;i<16;i++) printf("%02X",thesample[i]); | ||
printf("\n"); | ||
} | ||
|
||
|
||
int main() { | ||
|
||
unsigned char key[16]; | ||
unsigned char data[16]; | ||
unsigned char ciphertext[16]; | ||
|
||
int i; | ||
|
||
for(i=0;i<16;i++) { | ||
key[i]=0x00; | ||
data[i]=0x00; | ||
ciphertext[i]=0x00; | ||
} | ||
|
||
key[15]=0x01; | ||
data[15]=0x10; | ||
|
||
aesni128k128d(key,data,ciphertext); | ||
printsample(ciphertext); | ||
|
||
aessw128k128d(key,data,ciphertext); | ||
printsample(ciphertext); | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters