diff options
author | Werner Koch <wk@gnupg.org> | 2011-04-11 21:36:48 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2011-04-11 21:36:48 +0200 |
commit | eaee23fe56ca2d6bbbde8e883568b6b46445a240 (patch) | |
tree | cb746373efae0141cd15dad414d903922ea7eec6 /tests/basic.c | |
parent | 3c18377a55085faf4df745034056bac53565effa (diff) | |
download | libgcrypt-eaee23fe56ca2d6bbbde8e883568b6b46445a240.tar.gz |
CTR mode may now be used with arbitrary long data chunks.
Diffstat (limited to 'tests/basic.c')
-rw-r--r-- | tests/basic.c | 50 |
1 files changed, 49 insertions, 1 deletions
diff --git a/tests/basic.c b/tests/basic.c index a20e7317..2216476b 100644 --- a/tests/basic.c +++ b/tests/basic.c @@ -365,7 +365,7 @@ check_ctr_cipher (void) unsigned char plaintext[MAX_DATA_LEN]; int inlen; char out[MAX_DATA_LEN]; - } data[5]; + } data[8]; } tv[] = { /* http://csrc.nist.gov/publications/nistpubs/800-38a/sp800-38a.pdf */ @@ -470,6 +470,54 @@ check_ctr_cipher (void) {"", 0, "" } } }, + /* Tests to see whether it works correctly as a stream cipher. */ + { GCRY_CIPHER_AES, + "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff", + {{"\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a", + 16, + "\x87\x4d\x61\x91\xb6\x20\xe3\x26\x1b\xef\x68\x64\x99\x0d\xb6\xce" }, + {"\xae\x2d\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e", + 15, + "\x98\x06\xf6\x6b\x79\x70\xfd\xff\x86\x17\x18\x7b\xb9\xff\xfd" }, + {"\x51\x30\xc8\x1c\x46\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef", + 17, + "\xff\x5a\xe4\xdf\x3e\xdb\xd5\xd3\x5e\x5b\x4f\x09\x02\x0d\xb0\x3e\xab" }, + {"\xf6\x9f\x24\x45\xdf\x4f\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", + 16, + "\x1e\x03\x1d\xda\x2f\xbe\x03\xd1\x79\x21\x70\xa0\xf3\x00\x9c\xee" }, + + { "", 0, "" } + } + }, + { GCRY_CIPHER_AES, + "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff", + {{"\x6b", + 1, + "\x87" }, + {"\xc1\xbe", + 2, + "\x4d\x61" }, + {"\xe2\x2e\x40", + 3, + "\x91\xb6\x20" }, + {"\x9f", + 1, + "\xe3" }, + {"\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a", + 9, + "\x26\x1b\xef\x68\x64\x99\x0d\xb6\xce" }, + {"\xae\x2d\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e", + 15, + "\x98\x06\xf6\x6b\x79\x70\xfd\xff\x86\x17\x18\x7b\xb9\xff\xfd" }, + {"\x51\x30\xc8\x1c\x46\xa3\x5c\xe4\x11", + 9, + "\xff\x5a\xe4\xdf\x3e\xdb\xd5\xd3\x5e" }, + + { "", 0, "" } + } + }, #if USE_CAST5 /* A selfmade test vector using an 64 bit block cipher. */ { GCRY_CIPHER_CAST5, |