Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Benchmark demonstration program |
| 3 | * |
Paul Bakker | cce9d77 | 2011-11-18 14:26:47 +0000 | [diff] [blame] | 4 | * Copyright (C) 2006-2011, Brainspark B.V. |
Paul Bakker | b96f154 | 2010-07-18 20:36:00 +0000 | [diff] [blame] | 5 | * |
| 6 | * This file is part of PolarSSL (http://www.polarssl.org) |
Paul Bakker | 84f12b7 | 2010-07-18 10:13:04 +0000 | [diff] [blame] | 7 | * Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org> |
Paul Bakker | b96f154 | 2010-07-18 20:36:00 +0000 | [diff] [blame] | 8 | * |
Paul Bakker | 77b385e | 2009-07-28 17:23:11 +0000 | [diff] [blame] | 9 | * All rights reserved. |
Paul Bakker | e0ccd0a | 2009-01-04 16:27:10 +0000 | [diff] [blame] | 10 | * |
Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 11 | * This program is free software; you can redistribute it and/or modify |
| 12 | * it under the terms of the GNU General Public License as published by |
| 13 | * the Free Software Foundation; either version 2 of the License, or |
| 14 | * (at your option) any later version. |
| 15 | * |
| 16 | * This program is distributed in the hope that it will be useful, |
| 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 19 | * GNU General Public License for more details. |
| 20 | * |
| 21 | * You should have received a copy of the GNU General Public License along |
| 22 | * with this program; if not, write to the Free Software Foundation, Inc., |
| 23 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
| 24 | */ |
| 25 | |
| 26 | #ifndef _CRT_SECURE_NO_DEPRECATE |
| 27 | #define _CRT_SECURE_NO_DEPRECATE 1 |
| 28 | #endif |
| 29 | |
| 30 | #include <string.h> |
| 31 | #include <stdlib.h> |
| 32 | #include <stdio.h> |
| 33 | |
Paul Bakker | 40e4694 | 2009-01-03 21:51:57 +0000 | [diff] [blame] | 34 | #include "polarssl/config.h" |
Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 35 | |
Paul Bakker | 40e4694 | 2009-01-03 21:51:57 +0000 | [diff] [blame] | 36 | #include "polarssl/md4.h" |
| 37 | #include "polarssl/md5.h" |
| 38 | #include "polarssl/sha1.h" |
| 39 | #include "polarssl/sha2.h" |
Paul Bakker | 026c03b | 2009-03-28 17:53:03 +0000 | [diff] [blame] | 40 | #include "polarssl/sha4.h" |
Paul Bakker | 40e4694 | 2009-01-03 21:51:57 +0000 | [diff] [blame] | 41 | #include "polarssl/arc4.h" |
| 42 | #include "polarssl/des.h" |
| 43 | #include "polarssl/aes.h" |
Paul Bakker | 38119b1 | 2009-01-10 23:31:23 +0000 | [diff] [blame] | 44 | #include "polarssl/camellia.h" |
Paul Bakker | 40e4694 | 2009-01-03 21:51:57 +0000 | [diff] [blame] | 45 | #include "polarssl/rsa.h" |
| 46 | #include "polarssl/timing.h" |
Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 47 | |
| 48 | #define BUFSIZE 1024 |
| 49 | |
Paul Bakker | a3d195c | 2011-11-27 21:07:34 +0000 | [diff] [blame^] | 50 | static int myrand( void *rng_state, unsigned char *output, size_t len ) |
Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 51 | { |
Paul Bakker | a3d195c | 2011-11-27 21:07:34 +0000 | [diff] [blame^] | 52 | size_t use_len; |
| 53 | int rnd; |
| 54 | |
Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 55 | if( rng_state != NULL ) |
| 56 | rng_state = NULL; |
| 57 | |
Paul Bakker | a3d195c | 2011-11-27 21:07:34 +0000 | [diff] [blame^] | 58 | while( len > 0 ) |
| 59 | { |
| 60 | use_len = len; |
| 61 | if( use_len > sizeof(int) ) |
| 62 | use_len = sizeof(int); |
| 63 | |
| 64 | rnd = rand(); |
| 65 | memcpy( output, &rnd, use_len ); |
| 66 | output += use_len; |
| 67 | len -= use_len; |
| 68 | } |
| 69 | |
| 70 | return( 0 ); |
Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 71 | } |
| 72 | |
| 73 | unsigned char buf[BUFSIZE]; |
| 74 | |
Paul Bakker | 5690efc | 2011-05-26 13:16:06 +0000 | [diff] [blame] | 75 | #if !defined(POLARSSL_TIMING_C) |
Paul Bakker | cce9d77 | 2011-11-18 14:26:47 +0000 | [diff] [blame] | 76 | int main( int argc, char *argv[] ) |
Paul Bakker | 5690efc | 2011-05-26 13:16:06 +0000 | [diff] [blame] | 77 | { |
Paul Bakker | cce9d77 | 2011-11-18 14:26:47 +0000 | [diff] [blame] | 78 | ((void) argc); |
| 79 | ((void) argv); |
| 80 | |
Paul Bakker | 5690efc | 2011-05-26 13:16:06 +0000 | [diff] [blame] | 81 | printf("POLARSSL_TIMING_C not defined.\n"); |
| 82 | return( 0 ); |
| 83 | } |
| 84 | #else |
Paul Bakker | cce9d77 | 2011-11-18 14:26:47 +0000 | [diff] [blame] | 85 | int main( int argc, char *argv[] ) |
Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 86 | { |
| 87 | int keysize; |
| 88 | unsigned long i, j, tsc; |
Paul Bakker | 5a0aa77 | 2009-02-09 22:38:52 +0000 | [diff] [blame] | 89 | unsigned char tmp[64]; |
Paul Bakker | 40e4694 | 2009-01-03 21:51:57 +0000 | [diff] [blame] | 90 | #if defined(POLARSSL_ARC4_C) |
Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 91 | arc4_context arc4; |
| 92 | #endif |
Paul Bakker | 40e4694 | 2009-01-03 21:51:57 +0000 | [diff] [blame] | 93 | #if defined(POLARSSL_DES_C) |
Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 94 | des3_context des3; |
| 95 | des_context des; |
| 96 | #endif |
Paul Bakker | 40e4694 | 2009-01-03 21:51:57 +0000 | [diff] [blame] | 97 | #if defined(POLARSSL_AES_C) |
Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 98 | aes_context aes; |
| 99 | #endif |
Paul Bakker | 38119b1 | 2009-01-10 23:31:23 +0000 | [diff] [blame] | 100 | #if defined(POLARSSL_CAMELLIA_C) |
| 101 | camellia_context camellia; |
| 102 | #endif |
Paul Bakker | 5690efc | 2011-05-26 13:16:06 +0000 | [diff] [blame] | 103 | #if defined(POLARSSL_RSA_C) && defined(POLARSSL_BIGNUM_C) && \ |
| 104 | defined(POLARSSL_GENPRIME) |
Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 105 | rsa_context rsa; |
| 106 | #endif |
| 107 | |
Paul Bakker | cce9d77 | 2011-11-18 14:26:47 +0000 | [diff] [blame] | 108 | ((void) argc); |
| 109 | ((void) argv); |
| 110 | |
Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 111 | memset( buf, 0xAA, sizeof( buf ) ); |
| 112 | |
| 113 | printf( "\n" ); |
| 114 | |
Paul Bakker | 40e4694 | 2009-01-03 21:51:57 +0000 | [diff] [blame] | 115 | #if defined(POLARSSL_MD4_C) |
Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 116 | printf( " MD4 : " ); |
| 117 | fflush( stdout ); |
| 118 | |
| 119 | set_alarm( 1 ); |
| 120 | for( i = 1; ! alarmed; i++ ) |
| 121 | md4( buf, BUFSIZE, tmp ); |
| 122 | |
| 123 | tsc = hardclock(); |
| 124 | for( j = 0; j < 1024; j++ ) |
| 125 | md4( buf, BUFSIZE, tmp ); |
| 126 | |
| 127 | printf( "%9lu Kb/s, %9lu cycles/byte\n", i * BUFSIZE / 1024, |
| 128 | ( hardclock() - tsc ) / ( j * BUFSIZE ) ); |
| 129 | #endif |
| 130 | |
Paul Bakker | 40e4694 | 2009-01-03 21:51:57 +0000 | [diff] [blame] | 131 | #if defined(POLARSSL_MD5_C) |
Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 132 | printf( " MD5 : " ); |
| 133 | fflush( stdout ); |
| 134 | |
| 135 | set_alarm( 1 ); |
| 136 | for( i = 1; ! alarmed; i++ ) |
| 137 | md5( buf, BUFSIZE, tmp ); |
| 138 | |
| 139 | tsc = hardclock(); |
| 140 | for( j = 0; j < 1024; j++ ) |
| 141 | md5( buf, BUFSIZE, tmp ); |
| 142 | |
| 143 | printf( "%9lu Kb/s, %9lu cycles/byte\n", i * BUFSIZE / 1024, |
| 144 | ( hardclock() - tsc ) / ( j * BUFSIZE ) ); |
| 145 | #endif |
| 146 | |
Paul Bakker | 40e4694 | 2009-01-03 21:51:57 +0000 | [diff] [blame] | 147 | #if defined(POLARSSL_SHA1_C) |
Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 148 | printf( " SHA-1 : " ); |
| 149 | fflush( stdout ); |
| 150 | |
| 151 | set_alarm( 1 ); |
| 152 | for( i = 1; ! alarmed; i++ ) |
| 153 | sha1( buf, BUFSIZE, tmp ); |
| 154 | |
| 155 | tsc = hardclock(); |
| 156 | for( j = 0; j < 1024; j++ ) |
| 157 | sha1( buf, BUFSIZE, tmp ); |
| 158 | |
| 159 | printf( "%9lu Kb/s, %9lu cycles/byte\n", i * BUFSIZE / 1024, |
| 160 | ( hardclock() - tsc ) / ( j * BUFSIZE ) ); |
| 161 | #endif |
| 162 | |
Paul Bakker | 40e4694 | 2009-01-03 21:51:57 +0000 | [diff] [blame] | 163 | #if defined(POLARSSL_SHA2_C) |
Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 164 | printf( " SHA-256 : " ); |
| 165 | fflush( stdout ); |
| 166 | |
| 167 | set_alarm( 1 ); |
| 168 | for( i = 1; ! alarmed; i++ ) |
| 169 | sha2( buf, BUFSIZE, tmp, 0 ); |
| 170 | |
| 171 | tsc = hardclock(); |
| 172 | for( j = 0; j < 1024; j++ ) |
| 173 | sha2( buf, BUFSIZE, tmp, 0 ); |
| 174 | |
| 175 | printf( "%9lu Kb/s, %9lu cycles/byte\n", i * BUFSIZE / 1024, |
| 176 | ( hardclock() - tsc ) / ( j * BUFSIZE ) ); |
| 177 | #endif |
| 178 | |
Paul Bakker | 3a3c3c2 | 2009-02-09 22:33:30 +0000 | [diff] [blame] | 179 | #if defined(POLARSSL_SHA4_C) |
| 180 | printf( " SHA-512 : " ); |
| 181 | fflush( stdout ); |
| 182 | |
| 183 | set_alarm( 1 ); |
| 184 | for( i = 1; ! alarmed; i++ ) |
| 185 | sha4( buf, BUFSIZE, tmp, 0 ); |
| 186 | |
| 187 | tsc = hardclock(); |
| 188 | for( j = 0; j < 1024; j++ ) |
| 189 | sha4( buf, BUFSIZE, tmp, 0 ); |
| 190 | |
| 191 | printf( "%9lu Kb/s, %9lu cycles/byte\n", i * BUFSIZE / 1024, |
| 192 | ( hardclock() - tsc ) / ( j * BUFSIZE ) ); |
| 193 | #endif |
| 194 | |
Paul Bakker | 40e4694 | 2009-01-03 21:51:57 +0000 | [diff] [blame] | 195 | #if defined(POLARSSL_ARC4_C) |
Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 196 | printf( " ARC4 : " ); |
| 197 | fflush( stdout ); |
| 198 | |
| 199 | arc4_setup( &arc4, tmp, 32 ); |
| 200 | |
| 201 | set_alarm( 1 ); |
| 202 | for( i = 1; ! alarmed; i++ ) |
Paul Bakker | baad650 | 2010-03-21 15:42:15 +0000 | [diff] [blame] | 203 | arc4_crypt( &arc4, BUFSIZE, buf, buf ); |
Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 204 | |
| 205 | tsc = hardclock(); |
| 206 | for( j = 0; j < 1024; j++ ) |
Paul Bakker | baad650 | 2010-03-21 15:42:15 +0000 | [diff] [blame] | 207 | arc4_crypt( &arc4, BUFSIZE, buf, buf ); |
Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 208 | |
| 209 | printf( "%9lu Kb/s, %9lu cycles/byte\n", i * BUFSIZE / 1024, |
| 210 | ( hardclock() - tsc ) / ( j * BUFSIZE ) ); |
| 211 | #endif |
| 212 | |
Paul Bakker | 40e4694 | 2009-01-03 21:51:57 +0000 | [diff] [blame] | 213 | #if defined(POLARSSL_DES_C) |
Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 214 | printf( " 3DES : " ); |
| 215 | fflush( stdout ); |
| 216 | |
| 217 | des3_set3key_enc( &des3, tmp ); |
| 218 | |
| 219 | set_alarm( 1 ); |
| 220 | for( i = 1; ! alarmed; i++ ) |
| 221 | des3_crypt_cbc( &des3, DES_ENCRYPT, BUFSIZE, tmp, buf, buf ); |
| 222 | |
| 223 | tsc = hardclock(); |
| 224 | for( j = 0; j < 1024; j++ ) |
| 225 | des3_crypt_cbc( &des3, DES_ENCRYPT, BUFSIZE, tmp, buf, buf ); |
| 226 | |
| 227 | printf( "%9lu Kb/s, %9lu cycles/byte\n", i * BUFSIZE / 1024, |
| 228 | ( hardclock() - tsc ) / ( j * BUFSIZE ) ); |
| 229 | |
| 230 | printf( " DES : " ); |
| 231 | fflush( stdout ); |
| 232 | |
| 233 | des_setkey_enc( &des, tmp ); |
| 234 | |
| 235 | set_alarm( 1 ); |
| 236 | for( i = 1; ! alarmed; i++ ) |
| 237 | des_crypt_cbc( &des, DES_ENCRYPT, BUFSIZE, tmp, buf, buf ); |
| 238 | |
| 239 | tsc = hardclock(); |
| 240 | for( j = 0; j < 1024; j++ ) |
| 241 | des_crypt_cbc( &des, DES_ENCRYPT, BUFSIZE, tmp, buf, buf ); |
| 242 | |
| 243 | printf( "%9lu Kb/s, %9lu cycles/byte\n", i * BUFSIZE / 1024, |
| 244 | ( hardclock() - tsc ) / ( j * BUFSIZE ) ); |
| 245 | #endif |
| 246 | |
Paul Bakker | 40e4694 | 2009-01-03 21:51:57 +0000 | [diff] [blame] | 247 | #if defined(POLARSSL_AES_C) |
Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 248 | for( keysize = 128; keysize <= 256; keysize += 64 ) |
| 249 | { |
| 250 | printf( " AES-%d : ", keysize ); |
| 251 | fflush( stdout ); |
| 252 | |
| 253 | memset( buf, 0, sizeof( buf ) ); |
| 254 | memset( tmp, 0, sizeof( tmp ) ); |
| 255 | aes_setkey_enc( &aes, tmp, keysize ); |
| 256 | |
| 257 | set_alarm( 1 ); |
| 258 | |
| 259 | for( i = 1; ! alarmed; i++ ) |
| 260 | aes_crypt_cbc( &aes, AES_ENCRYPT, BUFSIZE, tmp, buf, buf ); |
| 261 | |
| 262 | tsc = hardclock(); |
| 263 | for( j = 0; j < 4096; j++ ) |
| 264 | aes_crypt_cbc( &aes, AES_ENCRYPT, BUFSIZE, tmp, buf, buf ); |
| 265 | |
| 266 | printf( "%9lu Kb/s, %9lu cycles/byte\n", i * BUFSIZE / 1024, |
| 267 | ( hardclock() - tsc ) / ( j * BUFSIZE ) ); |
| 268 | } |
| 269 | #endif |
| 270 | |
Paul Bakker | 38119b1 | 2009-01-10 23:31:23 +0000 | [diff] [blame] | 271 | #if defined(POLARSSL_CAMELLIA_C) |
| 272 | for( keysize = 128; keysize <= 256; keysize += 64 ) |
| 273 | { |
| 274 | printf( " CAMELLIA-%d : ", keysize ); |
| 275 | fflush( stdout ); |
| 276 | |
| 277 | memset( buf, 0, sizeof( buf ) ); |
| 278 | memset( tmp, 0, sizeof( tmp ) ); |
| 279 | camellia_setkey_enc( &camellia, tmp, keysize ); |
| 280 | |
| 281 | set_alarm( 1 ); |
| 282 | |
| 283 | for( i = 1; ! alarmed; i++ ) |
| 284 | camellia_crypt_cbc( &camellia, CAMELLIA_ENCRYPT, BUFSIZE, tmp, buf, buf ); |
| 285 | |
| 286 | tsc = hardclock(); |
| 287 | for( j = 0; j < 4096; j++ ) |
| 288 | camellia_crypt_cbc( &camellia, CAMELLIA_ENCRYPT, BUFSIZE, tmp, buf, buf ); |
| 289 | |
| 290 | printf( "%9lu Kb/s, %9lu cycles/byte\n", i * BUFSIZE / 1024, |
| 291 | ( hardclock() - tsc ) / ( j * BUFSIZE ) ); |
| 292 | } |
| 293 | #endif |
| 294 | |
Paul Bakker | 5690efc | 2011-05-26 13:16:06 +0000 | [diff] [blame] | 295 | #if defined(POLARSSL_RSA_C) && defined(POLARSSL_BIGNUM_C) && \ |
| 296 | defined(POLARSSL_GENPRIME) |
Paul Bakker | a802e1a | 2010-08-16 11:56:45 +0000 | [diff] [blame] | 297 | rsa_init( &rsa, RSA_PKCS_V15, 0 ); |
| 298 | rsa_gen_key( &rsa, myrand, NULL, 1024, 65537 ); |
Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 299 | |
| 300 | printf( " RSA-1024 : " ); |
| 301 | fflush( stdout ); |
| 302 | set_alarm( 3 ); |
| 303 | |
| 304 | for( i = 1; ! alarmed; i++ ) |
| 305 | { |
| 306 | buf[0] = 0; |
| 307 | rsa_public( &rsa, buf, buf ); |
| 308 | } |
| 309 | |
| 310 | printf( "%9lu public/s\n", i / 3 ); |
| 311 | |
| 312 | printf( " RSA-1024 : " ); |
| 313 | fflush( stdout ); |
| 314 | set_alarm( 3 ); |
| 315 | |
| 316 | for( i = 1; ! alarmed; i++ ) |
| 317 | { |
| 318 | buf[0] = 0; |
| 319 | rsa_private( &rsa, buf, buf ); |
| 320 | } |
| 321 | |
Paul Bakker | 1d4da2e | 2009-10-25 12:36:53 +0000 | [diff] [blame] | 322 | printf( "%9lu private/s\n", i / 3 ); |
| 323 | |
| 324 | rsa_free( &rsa ); |
| 325 | |
Paul Bakker | a802e1a | 2010-08-16 11:56:45 +0000 | [diff] [blame] | 326 | rsa_init( &rsa, RSA_PKCS_V15, 0 ); |
| 327 | rsa_gen_key( &rsa, myrand, NULL, 2048, 65537 ); |
Paul Bakker | 1d4da2e | 2009-10-25 12:36:53 +0000 | [diff] [blame] | 328 | |
| 329 | printf( " RSA-2048 : " ); |
| 330 | fflush( stdout ); |
| 331 | set_alarm( 3 ); |
| 332 | |
| 333 | for( i = 1; ! alarmed; i++ ) |
| 334 | { |
| 335 | buf[0] = 0; |
| 336 | rsa_public( &rsa, buf, buf ); |
| 337 | } |
| 338 | |
| 339 | printf( "%9lu public/s\n", i / 3 ); |
| 340 | |
| 341 | printf( " RSA-2048 : " ); |
| 342 | fflush( stdout ); |
| 343 | set_alarm( 3 ); |
| 344 | |
| 345 | for( i = 1; ! alarmed; i++ ) |
| 346 | { |
| 347 | buf[0] = 0; |
| 348 | rsa_private( &rsa, buf, buf ); |
| 349 | } |
| 350 | |
| 351 | printf( "%9lu private/s\n", i / 3 ); |
| 352 | |
| 353 | rsa_free( &rsa ); |
| 354 | |
Paul Bakker | a802e1a | 2010-08-16 11:56:45 +0000 | [diff] [blame] | 355 | rsa_init( &rsa, RSA_PKCS_V15, 0 ); |
| 356 | rsa_gen_key( &rsa, myrand, NULL, 4096, 65537 ); |
Paul Bakker | 1d4da2e | 2009-10-25 12:36:53 +0000 | [diff] [blame] | 357 | |
| 358 | printf( " RSA-4096 : " ); |
| 359 | fflush( stdout ); |
| 360 | set_alarm( 3 ); |
| 361 | |
| 362 | for( i = 1; ! alarmed; i++ ) |
| 363 | { |
| 364 | buf[0] = 0; |
| 365 | rsa_public( &rsa, buf, buf ); |
| 366 | } |
| 367 | |
| 368 | printf( "%9lu public/s\n", i / 3 ); |
| 369 | |
| 370 | printf( " RSA-4096 : " ); |
| 371 | fflush( stdout ); |
| 372 | set_alarm( 3 ); |
| 373 | |
| 374 | for( i = 1; ! alarmed; i++ ) |
| 375 | { |
| 376 | buf[0] = 0; |
| 377 | rsa_private( &rsa, buf, buf ); |
| 378 | } |
| 379 | |
| 380 | printf( "%9lu private/s\n", i / 3 ); |
Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 381 | |
| 382 | rsa_free( &rsa ); |
| 383 | #endif |
| 384 | |
Paul Bakker | 1d4da2e | 2009-10-25 12:36:53 +0000 | [diff] [blame] | 385 | printf( "\n" ); |
| 386 | |
Paul Bakker | cce9d77 | 2011-11-18 14:26:47 +0000 | [diff] [blame] | 387 | #if defined(_WIN32) |
Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 388 | printf( " Press Enter to exit this program.\n" ); |
| 389 | fflush( stdout ); getchar(); |
| 390 | #endif |
| 391 | |
| 392 | return( 0 ); |
| 393 | } |
Paul Bakker | 5690efc | 2011-05-26 13:16:06 +0000 | [diff] [blame] | 394 | #endif /* POLARSSL_TIMING_C */ |