aboutsummaryrefslogtreecommitdiff
path: root/libavutil/aes.c
diff options
context:
space:
mode:
authorMichael Niedermayer2007-01-14 16:45:34 +0000
committerMichael Niedermayer2007-01-14 16:45:34 +0000
commitcf5773e95f784514a3e69c4cb3fec3027162ad0b (patch)
tree634fe9fe0ad7844c27206bf3c0677c9e5d295301 /libavutil/aes.c
parentff8f6594290162965d2098a47807a515791a6522 (diff)
benchmark
Originally committed as revision 7480 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavutil/aes.c')
-rw-r--r--libavutil/aes.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavutil/aes.c b/libavutil/aes.c
index 3730e6aa90..78683b7aca 100644
--- a/libavutil/aes.c
+++ b/libavutil/aes.c
@@ -176,15 +176,19 @@ int main(){
AVAES *a= av_aes_init("PI=3.141592654..", 128);
uint8_t ct[16], pt[16], key[32];
+ av_log_level= AV_LOG_DEBUG;
+
for(i=0; i<10000; i++){
for(j=0; j<16; j++){
pt[j]= random();
}
memcpy(a->state, pt, 16);
+{START_TIMER
av_aes_encrypt(a);
if(!(i&(i-1)))
av_log(NULL, AV_LOG_ERROR, "%02X %02X %02X %02X\n", a->state[0][0], a->state[1][1], a->state[2][2], a->state[3][3]);
av_aes_decrypt(a);
+STOP_TIMER("aes")}
for(j=0; j<16; j++){
if(pt[j] != a->state[0][j]){
av_log(NULL, AV_LOG_ERROR, "%d %d %02X %02X\n", i,j, pt[j], a->state[0][j]);