summaryrefslogtreecommitdiffstats
path: root/lib/libssl/src
diff options
context:
space:
mode:
authormiod <miod@openbsd.org>2014-04-17 18:37:48 +0000
committermiod <miod@openbsd.org>2014-04-17 18:37:48 +0000
commitad9dab528902b19287655e3570116f0cbd6bdb01 (patch)
tree35419540fedf21d0451f2e8bd6712ed82788d3af /lib/libssl/src
parentcrypto/modes/gcm128.c can be used as its own selftest. Add it to regress, (diff)
downloadwireguard-openbsd-ad9dab528902b19287655e3570116f0cbd6bdb01.tar.xz
wireguard-openbsd-ad9dab528902b19287655e3570116f0cbd6bdb01.zip
Remove the benchmark part of the selftest. It uses the undocumented
OPENSSL_rdtsc() routine to get a high-precision timestamp, and (although this is the only user of this routine in libcrypto) forces every platform willing to provide fast assembly versions of some routines, to also provide OPENSSL_rdtsc().
Diffstat (limited to 'lib/libssl/src')
-rw-r--r--lib/libssl/src/crypto/modes/gcm128.c43
1 files changed, 0 insertions, 43 deletions
diff --git a/lib/libssl/src/crypto/modes/gcm128.c b/lib/libssl/src/crypto/modes/gcm128.c
index 52de0843182..a495db110fb 100644
--- a/lib/libssl/src/crypto/modes/gcm128.c
+++ b/lib/libssl/src/crypto/modes/gcm128.c
@@ -1857,49 +1857,6 @@ int main()
TEST_CASE(19);
TEST_CASE(20);
-#ifdef OPENSSL_CPUID_OBJ
- {
- size_t start,stop,gcm_t,ctr_t,OPENSSL_rdtsc();
- union { u64 u; u8 c[1024]; } buf;
- int i;
-
- AES_set_encrypt_key(K1,sizeof(K1)*8,&key);
- CRYPTO_gcm128_init(&ctx,&key,(block128_f)AES_encrypt);
- CRYPTO_gcm128_setiv(&ctx,IV1,sizeof(IV1));
-
- CRYPTO_gcm128_encrypt(&ctx,buf.c,buf.c,sizeof(buf));
- start = OPENSSL_rdtsc();
- CRYPTO_gcm128_encrypt(&ctx,buf.c,buf.c,sizeof(buf));
- gcm_t = OPENSSL_rdtsc() - start;
-
- CRYPTO_ctr128_encrypt(buf.c,buf.c,sizeof(buf),
- &key,ctx.Yi.c,ctx.EKi.c,&ctx.mres,
- (block128_f)AES_encrypt);
- start = OPENSSL_rdtsc();
- CRYPTO_ctr128_encrypt(buf.c,buf.c,sizeof(buf),
- &key,ctx.Yi.c,ctx.EKi.c,&ctx.mres,
- (block128_f)AES_encrypt);
- ctr_t = OPENSSL_rdtsc() - start;
-
- printf("%.2f-%.2f=%.2f\n",
- gcm_t/(double)sizeof(buf),
- ctr_t/(double)sizeof(buf),
- (gcm_t-ctr_t)/(double)sizeof(buf));
-#ifdef GHASH
- {
- void (*gcm_ghash_p)(u64 Xi[2],const u128 Htable[16],
- const u8 *inp,size_t len) = ctx.ghash;
-
- GHASH((&ctx),buf.c,sizeof(buf));
- start = OPENSSL_rdtsc();
- for (i=0;i<100;++i) GHASH((&ctx),buf.c,sizeof(buf));
- gcm_t = OPENSSL_rdtsc() - start;
- printf("%.2f\n",gcm_t/(double)sizeof(buf)/(double)i);
- }
-#endif
- }
-#endif
-
return ret;
}
#endif