test/x25519: First test speed, then test implementation

Makes it easier to tune implementation speed.

BRANCH=none
BUG=b:62813194
TEST=- Increase CONFIG_RO_SIZE to 60kb
     - Increase console stack size to 2048
     - Define CONFIG_CURVE25519_CORTEXM0 (next patch)
     make BOARD=hammer PROJECT=x25519 TEST_BUILD=y
     ./util/flash_ec --board=hammer --image=build/hammer/x25519.bin
     EC console: runtest

Change-Id: I9097e326a3772b2e05f9b90a68ac715ed467c442
Reviewed-on: https://chromium-review.googlesource.com/542636
Commit-Ready: Nicolas Boichat <drinkcat@chromium.org>
Tested-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
This commit is contained in:
Nicolas Boichat
2017-06-21 10:03:22 +08:00
committed by chrome-bot
parent 2e3b42610b
commit f7c89fc709

View File

@@ -153,15 +153,16 @@ static void test_x25519_speed(void)
void run_test(void)
{
watchdog_reload();
/* do not check speed, just as a benchmark */
test_x25519_speed();
watchdog_reload();
if (!test_x25519() || !test_x25519_iterated() ||
!test_x25519_small_order()) {
test_fail();
return;
}
watchdog_reload();
/* do not check speed, just as a benchmark */
test_x25519_speed();
test_pass();
}