From: Ben Laurie Date: Sat, 18 Aug 2001 16:02:52 +0000 (+0000) Subject: Add AES tests. X-Git-Tag: OpenSSL_0_9_6c~145^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a8a004987c730aa433b18e3d1f91198eca18e324;p=openssl Add AES tests. --- diff --git a/crypto/evp/evp_test.c b/crypto/evp/evp_test.c index 811574b21b..efbe9fa3c9 100644 --- a/crypto/evp/evp_test.c +++ b/crypto/evp/evp_test.c @@ -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,":"); diff --git a/crypto/evp/evptests.txt b/crypto/evp/evptests.txt index 05094a8d74..ee3b7fd69d 100644 --- a/crypto/evp/evptests.txt +++ b/crypto/evp/evptests.txt @@ -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