mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-09 17:11:42 +00:00
This change introduces a larger range of tests for bn_modinv_vartime. The tests are designed to run on a host, and compare results against openssl. BRANCH=none BUG=chrome-os-partner:47524 TEST=bn_test passes Change-Id: I2d6ea4824fa82f78f8797c0cfc2cf0dce03e8923 Signed-off-by: nagendra modadugu <ngm@google.com> Reviewed-on: https://chromium-review.googlesource.com/365232 Commit-Ready: Nagendra Modadugu <ngm@google.com> Tested-by: Nagendra Modadugu <ngm@google.com> Reviewed-by: Marius Schilder <mschilder@chromium.org> Reviewed-by: Bill Richardson <wfrichar@chromium.org>
18 lines
361 B
C
18 lines
361 B
C
/* Copyright 2016 The Chromium OS Authors. All rights reserved.
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
* found in the LICENSE file.
|
|
*/
|
|
|
|
#include "common.h"
|
|
|
|
#include <assert.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
|
|
#include <openssl/rand.h>
|
|
|
|
void rand_bytes(void *buf, size_t num)
|
|
{
|
|
assert(RAND_bytes(buf, num) == 1);
|
|
}
|