mbedtls/tests
Minos Galanakis 1a1b175554 test_suite_bignum: Added tests for mpi_get_montgomery_constant_unsafe()
This patch adds the test for the method calculating the RR. The input/expected
data are generated manually using the following Python3 snippet:

~~~~~
import math

title="mpi_get_montgomery_constant_unsafe"
tt = title + " #{}"

in_data = [ "0f", ... ]

def limb_no(number, bil=64):
    return int(math.ceil(int.bit_length(number)/(bil * 1.0)))

def calc_rr(number, bil=64 ):
    return '{:x}'.format(pow(pow(2, limb_no(number, bil) * bil), 2, number))

def calc_rr_str(number, prefix=""):
    rr64 = calc_rr(number)
    rr32 = calc_rr(number, bil=32)
    return '{}:"{:x}":"{}":"{}"'.format(prefix,number, rr32, rr64)

print("\n\n".join(["{}\n{}".format(tt.format(in_data.index(v)+1), calc_rr_str(int(v,base=16), title)) for v in in_data]))
~~~~~

Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2022-10-25 15:12:01 +01:00
..
.jenkins
configs
data_files Rename LMS private key files to match library name 2022-10-13 17:53:40 +01:00
docker/bionic
git-scripts Fix typographical errors in .md files found by cspell 2022-07-29 13:44:01 +01:00
include Remove KNOWN_MBEDTLS_SUPPORTED_HASH_ALG as it is now not used anywhere 2022-10-20 12:38:44 +02:00
opt-testcases ssl-opt.sh: Fix some test checks for ephemeral only kex build 2022-10-22 14:42:04 +02:00
scripts Merge pull request #6468 from gilles-peskine-arm/bignum-test-suite-names 2022-10-25 10:40:29 +02:00
src test_suite_psa_crypto: adapt dependenies and guards so the test can run in the driver-only build 2022-10-19 13:20:20 +02:00
suites test_suite_bignum: Added tests for mpi_get_montgomery_constant_unsafe() 2022-10-25 15:12:01 +01:00
.gitignore
CMakeLists.txt Add module for bignum_core test generation 2022-10-19 15:20:01 +01:00
compat-in-docker.sh
compat.sh
context-info.sh
Descriptions.txt
make-in-docker.sh
Makefile Add module for bignum_core test generation 2022-10-19 15:20:01 +01:00
ssl-opt-in-docker.sh
ssl-opt.sh ssl-opt.sh: Fix list of TLS 1.2 key exchanges with cert 2022-10-22 14:42:04 +02:00