[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] r9660: Add a quick-and-dirty AES benchmark function to the bottom o (in tor/trunk: . src/common)
- To: or-cvs@xxxxxxxxxxxxx
- Subject: [or-cvs] r9660: Add a quick-and-dirty AES benchmark function to the bottom o (in tor/trunk: . src/common)
- From: nickm@xxxxxxxx
- Date: Mon, 26 Feb 2007 13:33:56 -0500 (EST)
- Delivered-to: archiver@seul.org
- Delivered-to: or-cvs-outgoing@seul.org
- Delivered-to: or-cvs@seul.org
- Delivery-date: Mon, 26 Feb 2007 13:34:04 -0500
- Reply-to: or-talk@xxxxxxxxxxxxx
- Sender: owner-or-cvs@xxxxxxxxxxxxx
Author: nickm
Date: 2007-02-26 13:33:55 -0500 (Mon, 26 Feb 2007)
New Revision: 9660
Modified:
tor/trunk/
tor/trunk/src/common/aes.c
Log:
r11956@catbus: nickm | 2007-02-26 13:33:49 -0500
Add a quick-and-dirty AES benchmark function to the bottom of aes.c so I can go collecting data.
Property changes on: tor/trunk
___________________________________________________________________
svk:merge ticket from /tor/trunk [r11956] on 8246c3cf-6607-4228-993b-4d95d33730f1
Modified: tor/trunk/src/common/aes.c
===================================================================
--- tor/trunk/src/common/aes.c 2007-02-26 18:01:23 UTC (rev 9659)
+++ tor/trunk/src/common/aes.c 2007-02-26 18:33:55 UTC (rev 9660)
@@ -41,6 +41,7 @@
#undef USE_OPENSSL_AES
#undef USE_OPENSSL_EVP
#define USE_RIJNDAEL_COUNTER_OPTIMIZATION
+#undef FULL_UNROLL
/*======================================================================*/
/* From rijndael-alg-fst.h */
@@ -910,3 +911,20 @@
}
#endif
+#ifdef AES_BENCHMARK
+int
+main(int c, char **v)
+{
+ int i;
+ char blob[509]; /* the size of a cell payload. */
+ char blob_out[509];
+ aes_cnt_cipher_t *cipher = aes_new_cipher();
+ aes_set_key(cipher, "aesbenchmarkkey!", 128);
+ memset(blob, 'z', sizeof(blob));
+
+ for (i=0;i<1000000; ++i) {
+ aes_crypt(cipher, blob, sizeof(blob), blob_out);
+ }
+ return 0;
+}
+#endif