From: jsing Date: Fri, 23 Dec 2022 02:12:11 +0000 (+0000) Subject: Do similar setup for lshift and rshift benchmarks. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=62cf90648be63136122473e6de14c70e0213512e;p=openbsd Do similar setup for lshift and rshift benchmarks. This prevents realloc from unnecessarily impacting the lshift benchmarks. --- diff --git a/regress/lib/libcrypto/bn/bn_shift.c b/regress/lib/libcrypto/bn/bn_shift.c index 5ba5f5403e2..fd5184523bd 100644 --- a/regress/lib/libcrypto/bn/bn_shift.c +++ b/regress/lib/libcrypto/bn/bn_shift.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bn_shift.c,v 1.3 2022/12/18 00:22:07 tb Exp $ */ +/* $OpenBSD: bn_shift.c,v 1.4 2022/12/23 02:12:11 jsing Exp $ */ /* * Copyright (c) 2022 Joel Sing * @@ -319,6 +319,9 @@ benchmark_bn_lshift1(BIGNUM *bn) { int i; + if (!BN_set_bit(bn, 8192)) + errx(1, "BN_set_bit"); + if (!BN_one(bn)) errx(1, "BN_one"); @@ -333,6 +336,9 @@ benchmark_bn_lshift(BIGNUM *bn, int n) { int i; + if (!BN_set_bit(bn, 8192 * n)) + errx(1, "BN_set_bit"); + if (!BN_one(bn)) errx(1, "BN_one"); @@ -371,6 +377,9 @@ benchmark_bn_rshift1(BIGNUM *bn) { int i; + if (!BN_one(bn)) + errx(1, "BN_one"); + if (!BN_set_bit(bn, 8192)) errx(1, "BN_set_bit"); @@ -385,6 +394,9 @@ benchmark_bn_rshift(BIGNUM *bn, int n) { int i; + if (!BN_one(bn)) + errx(1, "BN_one"); + if (!BN_set_bit(bn, 8192 * n)) errx(1, "BN_set_bit");