Add AES tests.
authorBen Laurie <ben@openssl.org>
Sat, 18 Aug 2001 16:02:52 +0000 (16:02 +0000)
committerBen Laurie <ben@openssl.org>
Sat, 18 Aug 2001 16:02:52 +0000 (16:02 +0000)
crypto/evp/evp_test.c
crypto/evp/evptests.txt

index 811574b..efbe9fa 100644 (file)
@@ -206,7 +206,7 @@ int main(int argc,char **argv)
 
     for( ; ; )
        {
-       char acLine[4096];
+       char line[4096];
        char *p;
        char *cipher;
        unsigned char *iv,*key,*plaintext,*ciphertext;
@@ -214,11 +214,11 @@ int main(int argc,char **argv)
        int kn,in,pn,cn;
        ENGINE *e;
 
-       if(!fgets((char *)acLine,sizeof acLine,f))
+       if(!fgets((char *)line,sizeof line,f))
            break;
-       if(acLine[0] == '#')
+       if(line[0] == '#' || line[0] == '\n')
            continue;
-       p=acLine;
+       p=line;
        cipher=strsep(&p,":");  
        key=ustrsep(&p,":");
        iv=ustrsep(&p,":");
index 05094a8..ee3b7fd 100644 (file)
@@ -1,12 +1,36 @@
 #cipher:key:iv:input:output
+
+# AES 128 ECB tests (from NIST test vectors, encrypt)
+
+AES-128-ECB:00000000000000000000000000000000::00000000000000000000000000000000:C34C052CC0DA8D73451AFE5F03BE297F
+
+# AES 128 ECB tests (from NIST test vectors, decrypt)
+
+#AES-128-ECB:00000000000000000000000000000000::44416AC2D1F53C583303917E6BE9EBE0:00000000000000000000000000000000
+
+# AES 192 ECB tests (from NIST test vectors, decrypt)
+
+#AES-192-ECB:000000000000000000000000000000000000000000000000::48E31E9E256718F29229319C19F15BA4:00000000000000000000000000000000
+
+# AES 256 ECB tests (from NIST test vectors, decrypt)
+
+#AES-256-ECB:0000000000000000000000000000000000000000000000000000000000000000::058CCFFDBBCB382D1F6F56585D8A4ADE:00000000000000000000000000000000
+
 # AES 128 CBC tests (from NIST test vectors, encrypt)
+
 #AES-128-CBC:00000000000000000000000000000000:00000000000000000000000000000000:00000000000000000000000000000000:8A05FC5E095AF4848A08D328D3688E3D
+
 # AES 128 CBC tests (from NIST test vectors, decrypt)
+
 #AES-128-CBC:00000000000000000000000000000000:00000000000000000000000000000000:FACA37E0B0C85373DF706E73F7C9AF86:00000000000000000000000000000000
+
 # DES ECB tests (from destest)
+
 DES-ECB:0000000000000000::0000000000000000:8CA64DE9C1B123A7
+
 # DES EDE3 CBC tests (from destest)
 DES-EDE3-CBC:0123456789abcdeff1e0d3c2b5a49786fedcba9876543210:fedcba9876543210:37363534333231204E6F77206973207468652074696D6520666F722000000000:3FE301C962AC01D02213763C1CBD4CDC799657C064ECF5D41C673812CFDE9675
+
 # RC4 tests (from rc4test)
 RC4:0123456789abcdef0123456789abcdef::0123456789abcdef:75b7878099e0c596
 RC4:0123456789abcdef0123456789abcdef::0000000000000000:7494c2e7104b0879