2021-03-30 23:44:22 +02:00
|
|
|
Diffie-Hellman full exchange: tiny x_size
|
|
|
|
dhm_do_dhm:10:"93450983094850938450983409623":1:10:"9345098304850938450983409622":0
|
2009-07-08 21:47:36 +02:00
|
|
|
|
2021-03-30 23:44:22 +02:00
|
|
|
Diffie-Hellman full exchange: 5-bit, x_size=3
|
|
|
|
dhm_do_dhm:10:"23":3:10:"5":0
|
2009-07-08 21:47:36 +02:00
|
|
|
|
2021-03-30 23:44:22 +02:00
|
|
|
Diffie-Hellman full exchange: 5-bit, x_size=2
|
|
|
|
dhm_do_dhm:10:"23":2:10:"5":0
|
|
|
|
|
2021-04-13 22:16:45 +02:00
|
|
|
## Repeat this test case and a few similar ones several times. The RNG state
|
|
|
|
## changes, so we get to exercise the code with a few different values.
|
2021-03-30 23:33:49 +02:00
|
|
|
Diffie-Hellman full exchange: 5-bit #1
|
2021-03-30 23:44:22 +02:00
|
|
|
dhm_do_dhm:10:"23":1:10:"5":0
|
2009-07-08 21:47:36 +02:00
|
|
|
|
2021-03-30 23:33:49 +02:00
|
|
|
Diffie-Hellman full exchange: 5-bit #2
|
2021-03-30 23:44:22 +02:00
|
|
|
dhm_do_dhm:10:"23":1:10:"5":0
|
2021-03-30 23:33:49 +02:00
|
|
|
|
|
|
|
Diffie-Hellman full exchange: 5-bit #3
|
2021-03-30 23:44:22 +02:00
|
|
|
dhm_do_dhm:10:"23":1:10:"5":0
|
2021-03-30 23:33:49 +02:00
|
|
|
|
|
|
|
Diffie-Hellman full exchange: 5-bit #4
|
2021-03-30 23:44:22 +02:00
|
|
|
dhm_do_dhm:10:"23":1:10:"5":0
|
2021-03-30 23:33:49 +02:00
|
|
|
|
|
|
|
Diffie-Hellman full exchange: 5-bit #5
|
2021-03-30 23:44:22 +02:00
|
|
|
dhm_do_dhm:10:"23":1:10:"5":0
|
|
|
|
|
2021-04-13 22:26:27 +02:00
|
|
|
## This is x_size = P_size + 1. Arguably x_size > P_size makes no sense,
|
|
|
|
## but it's the current undocumented behavior to treat it the same as when
|
|
|
|
## x_size = P_size. If this behavior changes in the future, change the expected
|
|
|
|
## return status from 0 to MBEDTLS_ERR_DHM_BAD_INPUT_DATA.
|
2021-03-30 23:44:22 +02:00
|
|
|
Diffie-Hellman full exchange: 97-bit, x_size=14
|
|
|
|
dhm_do_dhm:10:"93450983094850938450983409623":14:10:"9345098304850938450983409622":0
|
2021-03-30 23:33:49 +02:00
|
|
|
|
|
|
|
Diffie-Hellman full exchange: 97-bit #1
|
2021-03-30 23:44:22 +02:00
|
|
|
dhm_do_dhm:10:"93450983094850938450983409623":13:10:"9345098304850938450983409622":0
|
2021-03-30 23:33:49 +02:00
|
|
|
|
|
|
|
Diffie-Hellman full exchange: 97-bit #2
|
2021-03-30 23:44:22 +02:00
|
|
|
dhm_do_dhm:10:"93450983094850938450983409623":13:10:"9345098304850938450983409622":0
|
2021-03-30 23:33:49 +02:00
|
|
|
|
|
|
|
Diffie-Hellman full exchange: 97-bit #3
|
2021-03-30 23:44:22 +02:00
|
|
|
dhm_do_dhm:10:"93450983094850938450983409623":13:10:"9345098304850938450983409622":0
|
2021-03-30 23:33:49 +02:00
|
|
|
|
|
|
|
Diffie-Hellman full exchange: 97-bit #4
|
2021-03-30 23:44:22 +02:00
|
|
|
dhm_do_dhm:10:"93450983094850938450983409623":13:10:"9345098304850938450983409622":0
|
2021-03-30 23:33:49 +02:00
|
|
|
|
|
|
|
Diffie-Hellman full exchange: 97-bit #5
|
2021-03-30 23:44:22 +02:00
|
|
|
dhm_do_dhm:10:"93450983094850938450983409623":13:10:"9345098304850938450983409622":0
|
|
|
|
|
|
|
|
Diffie-Hellman full exchange: 97-bit, x_size=12
|
|
|
|
dhm_do_dhm:10:"93450983094850938450983409623":12:10:"9345098304850938450983409622":0
|
|
|
|
|
|
|
|
Diffie-Hellman full exchange: 97-bit, x_size=11
|
|
|
|
dhm_do_dhm:10:"93450983094850938450983409623":11:10:"9345098304850938450983409622":0
|
|
|
|
|
|
|
|
Diffie-Hellman full exchange: 97-bit, x_size=1 #1
|
|
|
|
dhm_do_dhm:10:"93450983094850938450983409623":1:10:"9345098304850938450983409622":0
|
|
|
|
|
|
|
|
Diffie-Hellman full exchange: 97-bit, x_size=1 #2
|
|
|
|
dhm_do_dhm:10:"93450983094850938450983409623":1:10:"9345098304850938450983409622":0
|
|
|
|
|
|
|
|
Diffie-Hellman full exchange: 97-bit, x_size=1 #3
|
|
|
|
dhm_do_dhm:10:"93450983094850938450983409623":1:10:"9345098304850938450983409622":0
|
|
|
|
|
|
|
|
Diffie-Hellman full exchange: 97-bit, x_size=1 #4
|
|
|
|
dhm_do_dhm:10:"93450983094850938450983409623":1:10:"9345098304850938450983409622":0
|
|
|
|
|
|
|
|
Diffie-Hellman full exchange: 97-bit, x_size=1 #5
|
|
|
|
dhm_do_dhm:10:"93450983094850938450983409623":1:10:"9345098304850938450983409622":0
|
2009-07-08 21:47:36 +02:00
|
|
|
|
2021-03-30 23:33:49 +02:00
|
|
|
Diffie-Hellman full exchange: 286-bit
|
2021-03-30 23:44:22 +02:00
|
|
|
dhm_do_dhm:10:"93450983094850938450983409623982317398171298719873918739182739712938719287391879381271":36:10:"9345098309485093845098340962223981329819812792137312973297123912791271":0
|
2017-09-20 14:46:37 +02:00
|
|
|
|
|
|
|
Diffie-Hellman small modulus
|
2021-03-31 23:04:50 +02:00
|
|
|
dhm_do_dhm:10:"3":1:10:"5":MBEDTLS_ERR_DHM_MAKE_PARAMS_FAILED+MBEDTLS_ERR_MPI_BAD_INPUT_DATA
|
2017-09-20 14:46:37 +02:00
|
|
|
|
|
|
|
Diffie-Hellman zero modulus
|
2021-03-30 23:44:22 +02:00
|
|
|
dhm_do_dhm:10:"0":1:10:"5":MBEDTLS_ERR_DHM_BAD_INPUT_DATA
|
2013-09-15 17:43:54 +02:00
|
|
|
|
2021-06-09 13:37:31 +02:00
|
|
|
Diffie-Hellman with G=0
|
|
|
|
dhm_do_dhm:10:"93450983094850938450983409623":13:10:"0":MBEDTLS_ERR_DHM_BAD_INPUT_DATA
|
|
|
|
|
|
|
|
Diffie-Hellman with G=1
|
|
|
|
dhm_do_dhm:10:"93450983094850938450983409623":13:10:"1":MBEDTLS_ERR_DHM_BAD_INPUT_DATA
|
|
|
|
|
2021-06-15 21:53:47 +02:00
|
|
|
Diffie-Hellman with G=-1
|
|
|
|
dhm_do_dhm:10:"93450983094850938450983409623":13:10:"-1":MBEDTLS_ERR_DHM_BAD_INPUT_DATA
|
|
|
|
|
2021-06-09 13:37:31 +02:00
|
|
|
Diffie-Hellman with G=P-1
|
|
|
|
dhm_do_dhm:10:"93450983094850938450983409623":13:10:"93450983094850938450983409622":MBEDTLS_ERR_DHM_BAD_INPUT_DATA
|
|
|
|
|
|
|
|
Diffie-Hellman with G=P-2
|
|
|
|
dhm_do_dhm:10:"93450983094850938450983409623":13:10:"93450983094850938450983409621":0
|
|
|
|
|
|
|
|
Diffie-Hellman with G=P
|
|
|
|
dhm_do_dhm:10:"93450983094850938450983409623":13:10:"93450983094850938450983409623":MBEDTLS_ERR_DHM_BAD_INPUT_DATA
|
|
|
|
|
|
|
|
Diffie-Hellman with G=P+1
|
|
|
|
dhm_do_dhm:10:"93450983094850938450983409623":13:10:"93450983094850938450983409624":MBEDTLS_ERR_DHM_BAD_INPUT_DATA
|
|
|
|
|
|
|
|
Diffie-Hellman with G=P+2
|
|
|
|
dhm_do_dhm:10:"93450983094850938450983409623":13:10:"93450983094850938450983409625":0
|
|
|
|
|
2021-04-13 22:26:27 +02:00
|
|
|
Diffie-Hellman: x_size < 0
|
|
|
|
dhm_do_dhm:10:"93450983094850938450983409623":-1:10:"9345098304850938450983409622":MBEDTLS_ERR_DHM_BAD_INPUT_DATA
|
2013-09-15 17:43:54 +02:00
|
|
|
|
2020-12-02 11:41:50 +01:00
|
|
|
Diffie-Hellman MPI_MAX_SIZE modulus
|
|
|
|
dhm_make_public:MBEDTLS_MPI_MAX_SIZE:10:"5":0
|
|
|
|
|
|
|
|
Diffie-Hellman MPI_MAX_SIZE + 1 modulus
|
|
|
|
dhm_make_public:MBEDTLS_MPI_MAX_SIZE + 1:10:"5":MBEDTLS_ERR_DHM_MAKE_PUBLIC_FAILED+MBEDTLS_ERR_MPI_BAD_INPUT_DATA
|
2020-11-26 12:21:53 +01:00
|
|
|
|
Uniquify test case descriptions
Make check-test-cases.py pass.
Prior to this commit, there were many repeated test descriptions, but
none with the same test data and dependencies and comments, as checked
with the following command:
for x in tests/suites/*.data; do perl -00 -ne 'warn "$ARGV: $. = $seen{$_}\n" if $seen{$_}; $seen{$_}=$.' $x; done
Wherever a test suite contains multiple test cases with the exact same
description, add " [#1]", " [#2]", etc. to make the descriptions
unique. We don't currently use this particular arrangement of
punctuation, so all occurrences of " [#" were added by this script.
I used the following ad hoc code:
import sys
def fix_test_suite(data_file_name):
in_paragraph = False
total = {}
index = {}
lines = None
with open(data_file_name) as data_file:
lines = list(data_file.readlines())
for line in lines:
if line == '\n':
in_paragraph = False
continue
if line.startswith('#'):
continue
if not in_paragraph:
# This is a test case description line.
total[line] = total.get(line, 0) + 1
index[line] = 0
in_paragraph = True
with open(data_file_name, 'w') as data_file:
for line in lines:
if line in total and total[line] > 1:
index[line] += 1
line = '%s [#%d]\n' % (line[:-1], index[line])
data_file.write(line)
for data_file_name in sys.argv[1:]:
fix_test_suite(data_file_name)
2019-09-19 21:20:26 +02:00
|
|
|
Diffie-Hellman load parameters from file [#1]
|
2014-03-29 16:42:38 +01:00
|
|
|
dhm_file:"data_files/dhparams.pem":"9e35f430443a09904f3a39a979797d070df53378e79c2438bef4e761f3c714553328589b041c809be1d6c6b5f1fc9f47d3a25443188253a992a56818b37ba9de5a40d362e56eff0be5417474c125c199272c8fe41dea733df6f662c92ae76556e755d10c64e6a50968f67fc6ea73d0dca8569be2ba204e23580d8bca2f4975b3":"02":128
|
|
|
|
|
Uniquify test case descriptions
Make check-test-cases.py pass.
Prior to this commit, there were many repeated test descriptions, but
none with the same test data and dependencies and comments, as checked
with the following command:
for x in tests/suites/*.data; do perl -00 -ne 'warn "$ARGV: $. = $seen{$_}\n" if $seen{$_}; $seen{$_}=$.' $x; done
Wherever a test suite contains multiple test cases with the exact same
description, add " [#1]", " [#2]", etc. to make the descriptions
unique. We don't currently use this particular arrangement of
punctuation, so all occurrences of " [#" were added by this script.
I used the following ad hoc code:
import sys
def fix_test_suite(data_file_name):
in_paragraph = False
total = {}
index = {}
lines = None
with open(data_file_name) as data_file:
lines = list(data_file.readlines())
for line in lines:
if line == '\n':
in_paragraph = False
continue
if line.startswith('#'):
continue
if not in_paragraph:
# This is a test case description line.
total[line] = total.get(line, 0) + 1
index[line] = 0
in_paragraph = True
with open(data_file_name, 'w') as data_file:
for line in lines:
if line in total and total[line] > 1:
index[line] += 1
line = '%s [#%d]\n' % (line[:-1], index[line])
data_file.write(line)
for data_file_name in sys.argv[1:]:
fix_test_suite(data_file_name)
2019-09-19 21:20:26 +02:00
|
|
|
Diffie-Hellman load parameters from file [#2]
|
2015-04-15 13:50:29 +02:00
|
|
|
dhm_file:"data_files/dh.optlen.pem":"b3126aeaf47153c7d67f403030b292b5bd5a6c9eae1c137af34087fce2a36a578d70c5c560ad2bdb924c4a4dbee20a1671be7103ce87defa76908936803dbeca60c33e1289c1a03ac2c6c4e49405e5902fa0596a1cbaa895cc402d5213ed4a5f1f5ba8b5e1ed3da951a4c475afeb0ca660b7368c38c8e809f382d96ae19e60dc984e61cb42b5dfd723322acf327f9e413cda6400c15c5b2ea1fa34405d83982fba40e6d852da3d91019bf23511314254dc211a90833e5b1798ee52a78198c555644729ad92f060367c74ded37704adfc273a4a33fec821bd2ebd3bc051730e97a4dd14d2b766062592f5eec09d16bb50efebf2cc00dd3e0e3418e60ec84870f7":"800abfe7dc667aa17bcd7c04614bc221a65482ccc04b604602b0e131908a938ea11b48dc515dab7abcbb1e0c7fd66511edc0d86551b7632496e03df94357e1c4ea07a7ce1e381a2fcafdff5f5bf00df828806020e875c00926e4d011f88477a1b01927d73813cad4847c6396b9244621be2b00b63c659253318413443cd244215cd7fd4cbe796e82c6cf70f89cc0c528fb8e344809b31876e7ef739d5160d095c9684188b0c8755c7a468d47f56d6db9ea012924ecb0556fb71312a8d7c93bb2898ea08ee54eeb594548285f06a973cbbe2a0cb02e90f323fe045521f34c68354a6d3e95dbfff1eb64692edc0a44f3d3e408d0e479a541e779a6054259e2d854":256
|
|
|
|
|
2013-09-15 17:43:54 +02:00
|
|
|
Diffie-Hellman selftest
|
|
|
|
dhm_selftest:
|