blob: 794031901ab815e6b26b06d1fdbba529add96ffc [file] [log] [blame]
Manuel Pégourié-Gonnard770b5e12015-04-29 17:02:01 +02001Arguments with no value
2mpi_null:
3
Paul Bakker367dae42009-06-28 21:50:27 +00004Base test mpi_read_write_string #1
Paul Bakkerba48cb22009-07-12 11:01:32 +00005mpi_read_write_string:10:"128":10:"128":100:0:0
Paul Bakker367dae42009-06-28 21:50:27 +00006
Gilles Peskineb13a26c2021-04-03 18:25:29 +02007Base test mpi_read_write_string #1 (Leading 0)
8mpi_read_write_string:10:"0128":10:"128":100:0:0
9
Paul Bakker367dae42009-06-28 21:50:27 +000010Base test mpi_read_write_string #2
Paul Bakkerba48cb22009-07-12 11:01:32 +000011mpi_read_write_string:10:"128":16:"80":100:0:0
Paul Bakker367dae42009-06-28 21:50:27 +000012
Gilles Peskineb13a26c2021-04-03 18:25:29 +020013Base test mpi_read_write_string #3 (Read zero decimal)
Paul Bakkerba48cb22009-07-12 11:01:32 +000014mpi_read_write_string:10:"0":10:"0":100:0:0
Paul Bakker367dae42009-06-28 21:50:27 +000015
Gilles Peskineb13a26c2021-04-03 18:25:29 +020016Base test mpi_read_write_string #3 (Read zero hex)
17mpi_read_write_string:16:"0":16:"00":100:0:0
18
19Base test mpi_read_write_string #3 (Read minus zero decimal)
20mpi_read_write_string:10:"-0":10:"0":100:0:0
21
22Base test mpi_read_write_string #3 (Read minus zero hex)
23mpi_read_write_string:16:"-0":16:"00":100:0:0
24
25Base test mpi_read_write_string #3 (Negative decimal)
Paul Bakkerba48cb22009-07-12 11:01:32 +000026mpi_read_write_string:10:"-23":10:"-23":100:0:0
Paul Bakker367dae42009-06-28 21:50:27 +000027
Gilles Peskineb13a26c2021-04-03 18:25:29 +020028Base test mpi_read_write_string #3 (Negative decimal, leading 0)
29mpi_read_write_string:10:"-023":10:"-23":100:0:0
30
Gilles Peskinebd43f672021-04-09 15:46:40 +020031Base test mpi_read_write_string #3 (Negative hex -> decimal)
Paul Bakkerba48cb22009-07-12 11:01:32 +000032mpi_read_write_string:16:"-20":10:"-32":100:0:0
Paul Bakker367dae42009-06-28 21:50:27 +000033
Gilles Peskineb13a26c2021-04-03 18:25:29 +020034Base test mpi_read_write_string #3 (Negative hex)
Paul Bakkerba48cb22009-07-12 11:01:32 +000035mpi_read_write_string:16:"-23":16:"-23":100:0:0
Paul Bakker367dae42009-06-28 21:50:27 +000036
Gilles Peskineb13a26c2021-04-03 18:25:29 +020037Base test mpi_read_write_string #3 (Negative hex, leading 0)
38mpi_read_write_string:16:"-023":16:"-23":100:0:0
39
Janos Follath04dadb72019-03-06 12:29:37 +000040Base test mpi_read_write_string #4 (Buffer just fits)
41mpi_read_write_string:16:"-4":4:"-10":4:0:0
42
Paul Bakkerba48cb22009-07-12 11:01:32 +000043Test mpi_read_write_string #1 (Invalid character)
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020044mpi_read_write_string:10:"a28":0:"":100:MBEDTLS_ERR_MPI_INVALID_CHARACTER:0
Paul Bakkerba48cb22009-07-12 11:01:32 +000045
46Test mpi_read_write_string #2 (Illegal input radix)
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020047mpi_read_write_string:19:"a28":0:"":100:MBEDTLS_ERR_MPI_BAD_INPUT_DATA:0
Paul Bakkerba48cb22009-07-12 11:01:32 +000048
49Test mpi_read_write_string #3 (Buffer just fits)
50mpi_read_write_string:16:"-23":16:"-23":4:0:0
51
52Test mpi_read_write_string #4 (Buffer too small)
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020053mpi_read_write_string:16:"-23":16:"-23":3:0:MBEDTLS_ERR_MPI_BUFFER_TOO_SMALL
Paul Bakkerba48cb22009-07-12 11:01:32 +000054
55Test mpi_read_write_string #5 (Illegal output radix)
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020056mpi_read_write_string:16:"-23":17:"-23":4:0:MBEDTLS_ERR_MPI_BAD_INPUT_DATA
Paul Bakkerba48cb22009-07-12 11:01:32 +000057
58Test mpi_read_write_string #6 (Output radix of 15)
59mpi_read_write_string:10:"29":15:"1e":100:0:0
60
61Test mpi_read_write_string #7
62mpi_read_write_string:10:"56125680981752282334141896320372489490613963693556392520816017892111350604111697682705498319512049040516698827829292076808006940873974979584527073481012636016353913462376755556720019831187364993587901952757307830896531678727717924":16:"0941379d00fed1491fe15df284dfde4a142f68aa8d412023195cee66883e6290ffe703f4ea5963bf212713cee46b107c09182b5edcd955adac418bf4918e2889af48e1099d513830cec85c26ac1e158b52620e33ba8692f893efbb2f958b4424":200:0:0
Paul Bakkere896fea2009-07-06 06:40:23 +000063
Gilles Peskineb13a26c2021-04-03 18:25:29 +020064Test mpi_read_write_string #8 (Empty MPI hex -> hex)
Gilles Peskine7cba8592021-06-08 18:32:34 +020065mpi_read_write_string:16:"":16:"":4:0:0
Paul Bakker6c343d72014-07-10 14:36:19 +020066
Gilles Peskineb13a26c2021-04-03 18:25:29 +020067Test mpi_read_write_string #9 (Empty MPI hex -> dec)
Paul Bakker6c343d72014-07-10 14:36:19 +020068mpi_read_write_string:16:"":10:"0":4:0:0
69
Gilles Peskineae25bb02022-06-09 19:32:46 +020070Test mpi_read_write_string #9 (Empty MPI hex -> base 2)
71mpi_read_write_string:16:"":2:"0":4:0:0
72
Gilles Peskineb13a26c2021-04-03 18:25:29 +020073Test mpi_read_write_string #8 (Empty MPI dec -> hex)
Gilles Peskine7cba8592021-06-08 18:32:34 +020074mpi_read_write_string:10:"":16:"":4:0:0
Gilles Peskineb13a26c2021-04-03 18:25:29 +020075
76Test mpi_read_write_string #9 (Empty MPI dec -> dec)
77mpi_read_write_string:10:"":10:"0":4:0:0
78
Gilles Peskineae25bb02022-06-09 19:32:46 +020079Test mpi_read_write_string #9 (Empty MPI dec -> base 2)
80mpi_read_write_string:16:"":2:"0":4:0:0
81
Andres AGd1cc7f62017-01-06 13:17:35 +000082Test mpi_write_string #10 (Negative hex with odd number of digits)
83mpi_read_write_string:16:"-1":16:"":3:0:MBEDTLS_ERR_MPI_BUFFER_TOO_SMALL
84
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020085Base test mbedtls_mpi_read_binary #1
Tom Cosgrove1b2947a2022-09-02 10:24:55 +010086mpi_read_binary:"0941379d00fed1491fe15df284dfde4a142f68aa8d412023195cee66883e6290ffe703f4ea5963bf212713cee46b107c09182b5edcd955adac418bf4918e2889af48e1099d513830cec85c26ac1e158b52620e33ba8692f893efbb2f958b4424":"0941379D00FED1491FE15DF284DFDE4A142F68AA8D412023195CEE66883E6290FFE703F4EA5963BF212713CEE46B107C09182B5EDCD955ADAC418BF4918E2889AF48E1099D513830CEC85C26AC1E158B52620E33BA8692F893EFBB2F958B4424"
Paul Bakkere896fea2009-07-06 06:40:23 +000087
Janos Follatha778a942019-02-13 10:28:28 +000088Base test mbedtls_mpi_read_binary_le #1
Tom Cosgrove1b2947a2022-09-02 10:24:55 +010089mpi_read_binary_le:"0941379d00fed1491fe15df284dfde4a142f68aa8d412023195cee66883e6290ffe703f4ea5963bf212713cee46b107c09182b5edcd955adac418bf4918e2889af48e1099d513830cec85c26ac1e158b52620e33ba8692f893efbb2f958b4424":"24448B952FBBEF93F89286BA330E62528B151EAC265CC8CE3038519D09E148AF89288E91F48B41ACAD55D9DC5E2B18097C106BE4CE132721BF6359EAF403E7FF90623E8866EE5C192320418DAA682F144ADEDF84F25DE11F49D1FE009D374109"
Janos Follatha778a942019-02-13 10:28:28 +000090
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020091Base test mbedtls_mpi_write_binary #1
Tom Cosgrove1b2947a2022-09-02 10:24:55 +010092mpi_write_binary:"941379d00fed1491fe15df284dfde4a142f68aa8d412023195cee66883e6290ffe703f4ea5963bf212713cee46b107c09182b5edcd955adac418bf4918e2889af48e1099d513830cec85c26ac1e158b52620e33ba8692f893efbb2f958b4424":"0941379d00fed1491fe15df284dfde4a142f68aa8d412023195cee66883e6290ffe703f4ea5963bf212713cee46b107c09182b5edcd955adac418bf4918e2889af48e1099d513830cec85c26ac1e158b52620e33ba8692f893efbb2f958b4424":200:0
Paul Bakkerba48cb22009-07-12 11:01:32 +000093
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020094Test mbedtls_mpi_write_binary #1 (Buffer just fits)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +010095mpi_write_binary:"123123123123123123123123123":"0123123123123123123123123123":14:0
Paul Bakkerba48cb22009-07-12 11:01:32 +000096
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020097Test mbedtls_mpi_write_binary #2 (Buffer too small)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +010098mpi_write_binary:"123123123123123123123123123":"23123123123123123123123123":13:MBEDTLS_ERR_MPI_BUFFER_TOO_SMALL
Paul Bakkere896fea2009-07-06 06:40:23 +000099
Janos Follathe344d0f2019-02-19 16:17:40 +0000100Base test mbedtls_mpi_write_binary_le #1
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100101mpi_write_binary_le:"941379d00fed1491fe15df284dfde4a142f68aa8d412023195cee66883e6290ffe703f4ea5963bf212713cee46b107c09182b5edcd955adac418bf4918e2889af48e1099d513830cec85c26ac1e158b52620e33ba8692f893efbb2f958b4424":"24448b952fbbef93f89286ba330e62528b151eac265cc8ce3038519d09e148af89288e91f48b41acad55d9dc5e2b18097c106be4ce132721bf6359eaf403e7ff90623e8866ee5c192320418daa682f144adedf84f25de11f49d1fe009d374109":200:0
Janos Follathe344d0f2019-02-19 16:17:40 +0000102
103Test mbedtls_mpi_write_binary_le #1 (Buffer just fits)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100104mpi_write_binary_le:"123123123123123123123123123":"2331122331122331122331122301":14:0
Janos Follathe344d0f2019-02-19 16:17:40 +0000105
106Test mbedtls_mpi_write_binary_le #2 (Buffer too small)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100107mpi_write_binary_le:"123123123123123123123123123":"23311223311223311223311223":13:MBEDTLS_ERR_MPI_BUFFER_TOO_SMALL
Janos Follathe344d0f2019-02-19 16:17:40 +0000108
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200109Base test mbedtls_mpi_read_file #1
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100110mpi_read_file:"data_files/mpi_16":"01f55332c3a48b910f9942f6c914e58bef37a47ee45cb164a5b6b8d1006bf59a059c21449939ebebfdf517d2e1dbac88010d7b1f141e997bd6801ddaec9d05910f4f2de2b2c4d714e2c14a72fc7f17aa428d59c531627f09":0
Paul Bakkerba48cb22009-07-12 11:01:32 +0000111
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200112Test mbedtls_mpi_read_file #1 (Empty file)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100113mpi_read_file:"data_files/hash_file_4":"":MBEDTLS_ERR_MPI_FILE_IO_ERROR
Paul Bakkerba48cb22009-07-12 11:01:32 +0000114
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200115Test mbedtls_mpi_read_file #2 (Illegal input)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100116mpi_read_file:"data_files/hash_file_2":"":0
Paul Bakkere896fea2009-07-06 06:40:23 +0000117
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200118Test mbedtls_mpi_read_file #3 (Input too big)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100119mpi_read_file:"data_files/mpi_too_big":"":MBEDTLS_ERR_MPI_BUFFER_TOO_SMALL
Paul Bakkercb37aa52011-11-30 16:00:20 +0000120
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200121Base test mbedtls_mpi_write_file #1
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100122mpi_write_file:"941379d00fed1491fe15df284dfde4a142f68aa8d412023195cee66883e6290ffe703f4ea5963bf212713cee46b107c09182b5edcd955adac418bf4918e2889af48e1099d513830cec85c26ac1e158b52620e33ba8692f893efbb2f958b4424":"data_files/mpi_write"
Paul Bakkere896fea2009-07-06 06:40:23 +0000123
Gilles Peskine36374882021-06-08 23:01:13 +0200124Test mbedtls_mpi_lsb: 0 (null)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100125mpi_lsb:"":0
Gilles Peskine36374882021-06-08 23:01:13 +0200126
127Test mbedtls_mpi_lsb: 0 (1 limb)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100128mpi_lsb:"0":0
Gilles Peskine36374882021-06-08 23:01:13 +0200129
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200130Base test mbedtls_mpi_lsb #1
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100131mpi_lsb:"941379d00fed1491fe15df284dfde4a142f68aa8d412023195cee66883e6290ffe703f4ea5963bf212713cee46b107c09182b5edcd955adac418bf4918e2889af48e1099d513830cec85c26ac1e158b52620e33ba8692f893efbb2f958b4424":2
Paul Bakkere896fea2009-07-06 06:40:23 +0000132
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200133Base test mbedtls_mpi_lsb #2
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100134mpi_lsb:"18":3
Paul Bakkere896fea2009-07-06 06:40:23 +0000135
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200136Base test mbedtls_mpi_lsb #3
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100137mpi_lsb:"24":2
Paul Bakkere896fea2009-07-06 06:40:23 +0000138
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200139Base test mbedtls_mpi_lsb #4
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100140mpi_lsb:"2000":13
Paul Bakkere896fea2009-07-06 06:40:23 +0000141
Gilles Peskine24baa812022-10-09 21:16:28 +0200142Test mbedtls_mpi_bitlen 764-bit
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100143mpi_bitlen:"941379d00fed1491fe15df284dfde4a142f68aa8d412023195cee66883e6290ffe703f4ea5963bf212713cee46b107c09182b5edcd955adac418bf4918e2889af48e1099d513830cec85c26ac1e158b52620e33ba8692f893efbb2f958b4424":764
Paul Bakkere896fea2009-07-06 06:40:23 +0000144
Gilles Peskine24baa812022-10-09 21:16:28 +0200145Test mbedtls_mpi_bitlen 0x18
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100146mpi_bitlen:"18":5
Paul Bakkere896fea2009-07-06 06:40:23 +0000147
Gilles Peskinee9432832022-10-09 21:16:51 +0200148Test mbedtls_mpi_bitlen 0x18 with leading 0 limb(s)
149mpi_bitlen:"00000000000000018":5
150
151Test mbedtls_mpi_bitlen 0x18 << 64
152mpi_bitlen:"180000000000000000":69
153
Gilles Peskine24baa812022-10-09 21:16:28 +0200154Test mbedtls_mpi_bitlen 0x01
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100155mpi_bitlen:"1":1
Paul Bakkere896fea2009-07-06 06:40:23 +0000156
Gilles Peskine24baa812022-10-09 21:16:28 +0200157Test mbedtls_mpi_bitlen 0x0f
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100158mpi_bitlen:"f":4
Paul Bakkere896fea2009-07-06 06:40:23 +0000159
Gilles Peskine24baa812022-10-09 21:16:28 +0200160Test mbedtls_mpi_bitlen 0x10
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100161mpi_bitlen:"10":5
Paul Bakkere896fea2009-07-06 06:40:23 +0000162
Gilles Peskine24baa812022-10-09 21:16:28 +0200163Test mbedtls_mpi_bitlen 0x0a
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100164mpi_bitlen:"a":4
Paul Bakkere896fea2009-07-06 06:40:23 +0000165
Gilles Peskine24baa812022-10-09 21:16:28 +0200166Test mbedtls_mpi_bitlen: 0 (null)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100167mpi_bitlen:"":0
Gilles Peskine36374882021-06-08 23:01:13 +0200168
Gilles Peskine24baa812022-10-09 21:16:28 +0200169Test mbedtls_mpi_bitlen: 0 (1 limb)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100170mpi_bitlen:"0":0
Paul Bakkere896fea2009-07-06 06:40:23 +0000171
Gilles Peskinee9432832022-10-09 21:16:51 +0200172Test mbedtls_mpi_bitlen: -0x18
173mpi_bitlen:"-18":5
174
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200175Base test mbedtls_mpi_cmp_int #1
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100176mpi_cmp_int:693:693:0
Paul Bakker367dae42009-06-28 21:50:27 +0000177
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200178Base test mbedtls_mpi_cmp_int #2
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100179mpi_cmp_int:693:692:1
Paul Bakker367dae42009-06-28 21:50:27 +0000180
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200181Base test mbedtls_mpi_cmp_int #3
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100182mpi_cmp_int:693:694:-1
Paul Bakker367dae42009-06-28 21:50:27 +0000183
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200184Base test mbedtls_mpi_cmp_int (Negative values) #1
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100185mpi_cmp_int:-2:-2:0
Paul Bakker367dae42009-06-28 21:50:27 +0000186
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200187Base test mbedtls_mpi_cmp_int (Negative values) #2
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100188mpi_cmp_int:-2:-3:1
Paul Bakker367dae42009-06-28 21:50:27 +0000189
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200190Base test mbedtls_mpi_cmp_int (Negative values) #3
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100191mpi_cmp_int:-2:-1:-1
Paul Bakker367dae42009-06-28 21:50:27 +0000192
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200193Base test mbedtls_mpi_cmp_mpi #1
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100194mpi_cmp_mpi:"2b5":"2b5":0
Paul Bakker367dae42009-06-28 21:50:27 +0000195
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200196Base test mbedtls_mpi_cmp_mpi #2
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100197mpi_cmp_mpi:"2b5":"2b4":1
Paul Bakker367dae42009-06-28 21:50:27 +0000198
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200199Base test mbedtls_mpi_cmp_mpi #3
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100200mpi_cmp_mpi:"2b5":"2b6":-1
Paul Bakker367dae42009-06-28 21:50:27 +0000201
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200202Base test mbedtls_mpi_cmp_mpi (Negative values) #1
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100203mpi_cmp_mpi:"-2":"-2":0
Paul Bakker367dae42009-06-28 21:50:27 +0000204
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200205Base test mbedtls_mpi_cmp_mpi (Negative values) #2
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100206mpi_cmp_mpi:"-2":"-3":1
Paul Bakker367dae42009-06-28 21:50:27 +0000207
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200208Base test mbedtls_mpi_cmp_mpi (Negative values) #3
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100209mpi_cmp_mpi:"-2":"-1":-1
Paul Bakker367dae42009-06-28 21:50:27 +0000210
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200211Base test mbedtls_mpi_cmp_mpi (Mixed values) #4
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100212mpi_cmp_mpi:"-3":"2":-1
Paul Bakker0c8f73b2012-03-22 14:08:57 +0000213
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200214Base test mbedtls_mpi_cmp_mpi (Mixed values) #5
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100215mpi_cmp_mpi:"2":"-3":1
Paul Bakker0c8f73b2012-03-22 14:08:57 +0000216
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200217Base test mbedtls_mpi_cmp_mpi (Mixed values) #6
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100218mpi_cmp_mpi:"-2":"1c67967269c6":-1
Paul Bakker0c8f73b2012-03-22 14:08:57 +0000219
Gilles Peskine36374882021-06-08 23:01:13 +0200220Test mbedtls_mpi_cmp_mpi: 0 (null) = 0 (null)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100221mpi_cmp_mpi:"":"":0
Gilles Peskine36374882021-06-08 23:01:13 +0200222
223Test mbedtls_mpi_cmp_mpi: 0 (null) = 0 (1 limb)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100224mpi_cmp_mpi:"":"0":0
Gilles Peskine36374882021-06-08 23:01:13 +0200225
226Test mbedtls_mpi_cmp_mpi: 0 (1 limb) = 0 (null)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100227mpi_cmp_mpi:"0":"":0
Gilles Peskine36374882021-06-08 23:01:13 +0200228
229Test mbedtls_mpi_cmp_mpi: 0 (1 limb) = 0 (1 limb)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100230mpi_cmp_mpi:"0":"0":0
Gilles Peskine36374882021-06-08 23:01:13 +0200231
Gilles Peskine8f70d3f2021-06-15 22:01:23 +0200232Test mbedtls_mpi_cmp_mpi: 0 (null) < positive
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100233mpi_cmp_mpi:"":"7b":-1
Gilles Peskine8f70d3f2021-06-15 22:01:23 +0200234
235Test mbedtls_mpi_cmp_mpi: 0 (1 limb) < positive
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100236mpi_cmp_mpi:"0":"7b":-1
Gilles Peskine36374882021-06-08 23:01:13 +0200237
Gilles Peskine8f70d3f2021-06-15 22:01:23 +0200238Test mbedtls_mpi_cmp_mpi: 0 (null) > negative
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100239mpi_cmp_mpi:"":"-7b":1
Gilles Peskine8f70d3f2021-06-15 22:01:23 +0200240
241Test mbedtls_mpi_cmp_mpi: 0 (1 limb) > negative
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100242mpi_cmp_mpi:"0":"-7b":1
Gilles Peskine36374882021-06-08 23:01:13 +0200243
Gilles Peskine8f70d3f2021-06-15 22:01:23 +0200244Test mbedtls_mpi_cmp_mpi: positive > 0 (null)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100245mpi_cmp_mpi:"7b":"":1
Gilles Peskine36374882021-06-08 23:01:13 +0200246
Gilles Peskine8f70d3f2021-06-15 22:01:23 +0200247Test mbedtls_mpi_cmp_mpi: positive > 0 (1 limb)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100248mpi_cmp_mpi:"7b":"0":1
Gilles Peskine8f70d3f2021-06-15 22:01:23 +0200249
250Test mbedtls_mpi_cmp_mpi: negative < 0 (null)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100251mpi_cmp_mpi:"-7b":"":-1
Gilles Peskine36374882021-06-08 23:01:13 +0200252
Gilles Peskine8f70d3f2021-06-15 22:01:23 +0200253Test mbedtls_mpi_cmp_mpi: negative < 0 (1 limb)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100254mpi_cmp_mpi:"-7b":"0":-1
Gilles Peskine8f70d3f2021-06-15 22:01:23 +0200255
256Test mbedtls_mpi_cmp_mpi: 0 (null) < positive with leading zero limb
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100257mpi_cmp_mpi:"":"0000000000000000123":-1
Gilles Peskine8f70d3f2021-06-15 22:01:23 +0200258
259Test mbedtls_mpi_cmp_mpi: 0 (1 limb) < positive with leading zero limb
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100260mpi_cmp_mpi:"0":"0000000000000000123":-1
Gilles Peskine8f70d3f2021-06-15 22:01:23 +0200261
262Test mbedtls_mpi_cmp_mpi: 0 (null) > negative with leading zero limb
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100263mpi_cmp_mpi:"":"-0000000000000000123":1
Gilles Peskine8f70d3f2021-06-15 22:01:23 +0200264
265Test mbedtls_mpi_cmp_mpi: 0 (1 limb) > negative with leading zero limb
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100266mpi_cmp_mpi:"0":"-0000000000000000123":1
Gilles Peskine8f70d3f2021-06-15 22:01:23 +0200267
268Test mbedtls_mpi_cmp_mpi: positive with leading zero limb > 0 (null)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100269mpi_cmp_mpi:"0000000000000000123":"":1
Gilles Peskine8f70d3f2021-06-15 22:01:23 +0200270
271Test mbedtls_mpi_cmp_mpi: positive with leading zero limb > 0 (1 limb)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100272mpi_cmp_mpi:"0000000000000000123":"0":1
Gilles Peskine8f70d3f2021-06-15 22:01:23 +0200273
274Test mbedtls_mpi_cmp_mpi: negative with leading zero limb < 0 (null)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100275mpi_cmp_mpi:"-0000000000000000123":"":-1
Gilles Peskine8f70d3f2021-06-15 22:01:23 +0200276
277Test mbedtls_mpi_cmp_mpi: negative with leading zero limb < 0 (1 limb)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100278mpi_cmp_mpi:"-0000000000000000123":"0":-1
Gilles Peskine8f70d3f2021-06-15 22:01:23 +0200279
280Test mbedtls_mpi_cmp_mpi: 0 (null) < large positive
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100281mpi_cmp_mpi:"":"1230000000000000000":-1
Gilles Peskine8f70d3f2021-06-15 22:01:23 +0200282
283Test mbedtls_mpi_cmp_mpi: 0 (1 limb) < large positive
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100284mpi_cmp_mpi:"0":"1230000000000000000":-1
Gilles Peskine8f70d3f2021-06-15 22:01:23 +0200285
286Test mbedtls_mpi_cmp_mpi: 0 (null) > large negative
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100287mpi_cmp_mpi:"":"-1230000000000000000":1
Gilles Peskine8f70d3f2021-06-15 22:01:23 +0200288
289Test mbedtls_mpi_cmp_mpi: 0 (1 limb) > large negative
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100290mpi_cmp_mpi:"0":"-1230000000000000000":1
Gilles Peskine8f70d3f2021-06-15 22:01:23 +0200291
292Test mbedtls_mpi_cmp_mpi: large positive > 0 (null)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100293mpi_cmp_mpi:"1230000000000000000":"":1
Gilles Peskine8f70d3f2021-06-15 22:01:23 +0200294
295Test mbedtls_mpi_cmp_mpi: large positive > 0 (1 limb)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100296mpi_cmp_mpi:"1230000000000000000":"0":1
Gilles Peskine8f70d3f2021-06-15 22:01:23 +0200297
298Test mbedtls_mpi_cmp_mpi: large negative < 0 (null)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100299mpi_cmp_mpi:"-1230000000000000000":"":-1
Gilles Peskine8f70d3f2021-06-15 22:01:23 +0200300
301Test mbedtls_mpi_cmp_mpi: large negative < 0 (1 limb)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100302mpi_cmp_mpi:"-1230000000000000000":"0":-1
Gilles Peskine8f70d3f2021-06-15 22:01:23 +0200303
Gabor Mezei02e5d432022-10-03 16:45:11 +0200304mbedtls_mpi_core_cond_assign: 1 limb
Gabor Mezeia67a1a32022-10-10 15:25:59 +0200305mpi_core_cond_assign:"FFFFFFFF":"11111111":4
Gabor Mezei02e5d432022-10-03 16:45:11 +0200306
Gabor Mezei44ba2f62022-10-10 15:32:12 +0200307mbedtls_mpi_core_cond_assign: more limbs #1
Gabor Mezeia67a1a32022-10-10 15:25:59 +0200308mpi_core_cond_assign:"00000000FFFFFFFF55555555AAAAAAAA":"0123456789ABCDEF0123456789ABCDEF":16
Gabor Mezei02e5d432022-10-03 16:45:11 +0200309
Gabor Mezei44ba2f62022-10-10 15:32:12 +0200310mbedtls_mpi_core_cond_assign: more limbs #2
311mpi_core_cond_assign:"11111111EEEEEEEE77777777CCCCCCCC":"FEDCBA9876543210FEDCBA9876543210":16
312
313mbedtls_mpi_core_cond_assign: more limbs #3
314mpi_core_cond_assign:"562D2B7E83BDC6FF783CEC0D6F46EAE7":"4C314E3B5CEB009C25F3300D5ECF670A":16
315
Gabor Mezei02e5d432022-10-03 16:45:11 +0200316mbedtls_mpi_core_cond_assign: copy 256 bytes of limbs
Gabor Mezeia67a1a32022-10-10 15:25:59 +0200317mpi_core_cond_assign:"00000000111111112222222233333333444444445555555566666666777777778888888899999999AAAAAAAABBBBBBBBCCCCCCCCDDDDDDDDEEEEEEEEFFFFFFFF00000000111111112222222233333333444444445555555566666666777777778888888899999999AAAAAAAABBBBBBBBCCCCCCCCDDDDDDDDEEEEEEEEFFFFFFFF00000000111111112222222233333333444444445555555566666666777777778888888899999999AAAAAAAABBBBBBBBCCCCCCCCDDDDDDDDEEEEEEEEFFFFFFFF00000000111111112222222233333333444444445555555566666666777777778888888899999999AAAAAAAABBBBBBBBCCCCCCCCDDDDDDDDEEEEEEEEFFFFFFFF":"6E3173EEAC8D68A5AB53D259F32D9E9C298FD2C4FAD3BEE9151DC103EA2382F5480C7D11F451C060A1E3D887E05A620EF6395763CB7A40FC473DD0771456A018E18635EA971C36DCAD09D60E8BD0E2E0CCD1AECB8BE0ABA881DBE60163F6C45947EC0B05FDAAA3DF944627DD4FACBAD3FF2AB4B99D91E548C06A4AF320A9CA0D2FD0CB19B90B9D6A8BF59CB631DD925B6DEA621FE962099D3D0BED6B13C0C546DC6B563A7FC63B1B77D277897DD7B9DF28C4C9213A183B83D982964C6AD8192CE7354B11ED727EDEF85074C46E4E2E6C1728FB7980385CDB36512F927847C6A14A118624ABC12B09DBEE60D651B5431AAD982228C61655EABB80C263871AE1CF":256
Gabor Mezei02e5d432022-10-03 16:45:11 +0200318
319mbedtls_mpi_core_cond_assign: copy half of the limbs
Gabor Mezeia67a1a32022-10-10 15:25:59 +0200320mpi_core_cond_assign:"00000000FFFFFFFF55555555AAAAAAAA":"FEDCBA9876543210FEDCBA9876543210":8
Gabor Mezeib27b1c52022-09-12 16:36:48 +0200321
Gabor Mezei821d1512022-09-27 12:41:28 +0200322mbedtls_mpi_core_cond_swap: same value
Gabor Mezeia67a1a32022-10-10 15:25:59 +0200323mpi_core_cond_swap:"FFFFFFFF":"FFFFFFFF":4
Gabor Mezeib27b1c52022-09-12 16:36:48 +0200324
Gabor Mezei02e5d432022-10-03 16:45:11 +0200325mbedtls_mpi_core_cond_swap: 1 limb
Gabor Mezeia67a1a32022-10-10 15:25:59 +0200326mpi_core_cond_swap:"FFFFFFFF":"11111111":4
Gabor Mezeib27b1c52022-09-12 16:36:48 +0200327
Gabor Mezei44ba2f62022-10-10 15:32:12 +0200328mbedtls_mpi_core_cond_swap: more limbs #1
Gabor Mezeia67a1a32022-10-10 15:25:59 +0200329mpi_core_cond_swap:"00000000FFFFFFFF55555555AAAAAAAA":"0123456789ABCDEF0123456789ABCDEF":16
Gabor Mezei02e5d432022-10-03 16:45:11 +0200330
Gabor Mezei44ba2f62022-10-10 15:32:12 +0200331mbedtls_mpi_core_cond_swap: more limbs #2
332mpi_core_cond_swap:"11111111EEEEEEEE77777777CCCCCCCC":"FEDCBA9876543210FEDCBA9876543210":16
333
334mbedtls_mpi_core_cond_swap: more limbs #3
335mpi_core_cond_swap:"562D2B7E83BDC6FF783CEC0D6F46EAE7":"4C314E3B5CEB009C25F3300D5ECF670A":16
336
Gabor Mezei02e5d432022-10-03 16:45:11 +0200337mbedtls_mpi_core_cond_swap: copy 256 bytes of limbs
Gabor Mezeia67a1a32022-10-10 15:25:59 +0200338mpi_core_cond_swap:"00000000111111112222222233333333444444445555555566666666777777778888888899999999AAAAAAAABBBBBBBBCCCCCCCCDDDDDDDDEEEEEEEEFFFFFFFF00000000111111112222222233333333444444445555555566666666777777778888888899999999AAAAAAAABBBBBBBBCCCCCCCCDDDDDDDDEEEEEEEEFFFFFFFF00000000111111112222222233333333444444445555555566666666777777778888888899999999AAAAAAAABBBBBBBBCCCCCCCCDDDDDDDDEEEEEEEEFFFFFFFF00000000111111112222222233333333444444445555555566666666777777778888888899999999AAAAAAAABBBBBBBBCCCCCCCCDDDDDDDDEEEEEEEEFFFFFFFF":"9FBBA284460D8EAB5E0D66B634BD18FBA58C0C25417DD637526A7622C6425B46E09AEFBB8C2340AC823DFE990A62C85DB23BCDBEA734134606CEEB4BCF7444569D5EC4E32341ED09D7A5D0BB8B11D7B726BAECCF37D4FC1BEBD892CADD7BE9E093343C1A68D7A188DFE145C1EDBD8048B24E20A076F981D75ABE44318ADC40ED316C444774B6A90D3EE49557315AA6FAB162A498C0B2E2C15BD94186A665E12DDC39211583FA5F21218A3B46999FEBA4DFF454FB6ED35B8F3AE5F8EA840838BD76006DA112F85EDAA2CC07518FFC9724D5695BAF74F16C8D1A3A06029D2F5C1023D9E8A84D1267BD9AF82D1F5F77092D34BE4E8C4D1EA8C58F90B094DCFD6920":256
Gabor Mezei02e5d432022-10-03 16:45:11 +0200339
340mbedtls_mpi_core_cond_swap: copy half of the limbs
Gabor Mezeia67a1a32022-10-10 15:25:59 +0200341mpi_core_cond_swap:"00000000FFFFFFFF55555555AAAAAAAA":"FEDCBA9876543210FEDCBA9876543210":8
Gabor Mezei02e5d432022-10-03 16:45:11 +0200342
343mbedtls_mpi_mod_raw_cond_assign: 1 limb
Gabor Mezeia67a1a32022-10-10 15:25:59 +0200344mpi_mod_raw_cond_assign:"FFFFFFFF":"11111111":4
Gabor Mezei02e5d432022-10-03 16:45:11 +0200345
Gabor Mezei44ba2f62022-10-10 15:32:12 +0200346mbedtls_mpi_mod_raw_cond_assign: more limbs #1
Gabor Mezeia67a1a32022-10-10 15:25:59 +0200347mpi_mod_raw_cond_assign:"00000000FFFFFFFF55555555AAAAAAAA":"0123456789ABCDEF0123456789ABCDEF":16
Gabor Mezei02e5d432022-10-03 16:45:11 +0200348
Gabor Mezei44ba2f62022-10-10 15:32:12 +0200349mbedtls_mpi_mod_raw_cond_assign: more limbs #2
350mpi_mod_raw_cond_assign:"11111111EEEEEEEE77777777CCCCCCCC":"FEDCBA9876543210FEDCBA9876543210":16
351
352mbedtls_mpi_mod_raw_cond_assign: more limbs #3
353mpi_mod_raw_cond_assign:"562D2B7E83BDC6FF783CEC0D6F46EAE7":"4C314E3B5CEB009C25F3300D5ECF670A":16
354
Gabor Mezei02e5d432022-10-03 16:45:11 +0200355mbedtls_mpi_mod_raw_cond_assign: copy 256 bytes of limbs
Gabor Mezeia67a1a32022-10-10 15:25:59 +0200356mpi_mod_raw_cond_assign:"00000000111111112222222233333333444444445555555566666666777777778888888899999999AAAAAAAABBBBBBBBCCCCCCCCDDDDDDDDEEEEEEEEFFFFFFFF00000000111111112222222233333333444444445555555566666666777777778888888899999999AAAAAAAABBBBBBBBCCCCCCCCDDDDDDDDEEEEEEEEFFFFFFFF00000000111111112222222233333333444444445555555566666666777777778888888899999999AAAAAAAABBBBBBBBCCCCCCCCDDDDDDDDEEEEEEEEFFFFFFFF00000000111111112222222233333333444444445555555566666666777777778888888899999999AAAAAAAABBBBBBBBCCCCCCCCDDDDDDDDEEEEEEEEFFFFFFFF":"38AAE958A11CCE9F4B4D0EDF64D31DF6FEA451D56B3BAB3DB796739B96C5C9C619DAE2AD5394D41FC3746A4F35BA186F02D908E900A2BA5AC95D494378A6A6FC619801DA3F3B4C5BAAA49B16DD3B2EF9AFB4B82449F90628E1438405D321ACA8476EA3E7124D46D5F25CD57143F2C6A022F7D6EBF7C726AEF56D97E3944EACD627A814D2F546F5A659DD316AE57584BC46F0D976D537E78AB09D2599BB0F073366C541CEF4B6D76FE72D000A01167FCE506B805B295C12BFCAA3B768D8E6AA50D939BDB519A94000B7B18B2D36AE888EDC33DC933E9612D112BB7A95D0748F175E69F00B9D8470C64E27B4FF39551B09FF046F864E9FC22A3E1F73570DF31214":256
Gabor Mezei02e5d432022-10-03 16:45:11 +0200357
358mbedtls_mpi_mod_raw_cond_assign: copy half of the limbs
Gabor Mezeia67a1a32022-10-10 15:25:59 +0200359mpi_mod_raw_cond_assign:"00000000FFFFFFFF55555555AAAAAAAA":"FEDCBA9876543210FEDCBA9876543210":8
Gabor Mezeib27b1c52022-09-12 16:36:48 +0200360
Gabor Mezei821d1512022-09-27 12:41:28 +0200361mbedtls_mpi_mod_raw_cond_swap: same value
Gabor Mezeia67a1a32022-10-10 15:25:59 +0200362mpi_mod_raw_cond_swap:"FFFFFFFF":"FFFFFFFF":4
Gabor Mezeib27b1c52022-09-12 16:36:48 +0200363
Gabor Mezei02e5d432022-10-03 16:45:11 +0200364mbedtls_mpi_mod_raw_cond_swap: 1 limb
Gabor Mezeia67a1a32022-10-10 15:25:59 +0200365mpi_mod_raw_cond_swap:"FFFFFFFF":"11111111":4
Gabor Mezei02e5d432022-10-03 16:45:11 +0200366
Gabor Mezei44ba2f62022-10-10 15:32:12 +0200367mbedtls_mpi_mod_raw_cond_swap: more limbs #1
Gabor Mezeia67a1a32022-10-10 15:25:59 +0200368mpi_mod_raw_cond_swap:"00000000FFFFFFFF55555555AAAAAAAA":"0123456789ABCDEF0123456789ABCDEF":16
Gabor Mezei02e5d432022-10-03 16:45:11 +0200369
Gabor Mezei44ba2f62022-10-10 15:32:12 +0200370mbedtls_mpi_mod_raw_cond_swap: more limbs #2
371mpi_mod_raw_cond_swap:"11111111EEEEEEEE77777777CCCCCCCC":"FEDCBA9876543210FEDCBA9876543210":16
372
373mbedtls_mpi_mod_raw_cond_swap: more limbs #3
374mpi_mod_raw_cond_swap:"562D2B7E83BDC6FF783CEC0D6F46EAE7":"4C314E3B5CEB009C25F3300D5ECF670A":16
375
Gabor Mezei02e5d432022-10-03 16:45:11 +0200376mbedtls_mpi_mod_raw_cond_swap: copy 256 bytes of limbs
Gabor Mezeia67a1a32022-10-10 15:25:59 +0200377mpi_mod_raw_cond_swap:"00000000111111112222222233333333444444445555555566666666777777778888888899999999AAAAAAAABBBBBBBBCCCCCCCCDDDDDDDDEEEEEEEEFFFFFFFF00000000111111112222222233333333444444445555555566666666777777778888888899999999AAAAAAAABBBBBBBBCCCCCCCCDDDDDDDDEEEEEEEEFFFFFFFF00000000111111112222222233333333444444445555555566666666777777778888888899999999AAAAAAAABBBBBBBBCCCCCCCCDDDDDDDDEEEEEEEEFFFFFFFF00000000111111112222222233333333444444445555555566666666777777778888888899999999AAAAAAAABBBBBBBBCCCCCCCCDDDDDDDDEEEEEEEEFFFFFFFF":"A6154F6146E5AE06C705EF228DB022B4C0C908D9FF11E83CB0836A37DD11D72B5AE0D053B6D0B376B015E3B09DCC04644F12CBCBD0407300DEDA1D817E99A030BA128A57494F6C6BC650A840B70B3A1CDF8A75A387184C93DEF02DD538C60E8764AD2E4600952E09D24DC5524AB34070D25D204174D23B2BFDACBC67F8973C47FAF01CE9810130934AB6A94C5E6D223EDEAE904FD18368231AC3113C2CD73E879124CE21FC379C695C41D6861F5FB957570C3E6EF61F4FBA5D9945FB42931FC8E68370177DB313BEB7AF79B1F0F872368946FF35BD059E60677342EB3A0431714044AD508CD244B7CE200C5DC75B3BC7846A4CF0436C9288F2153124C9283171":256
Gabor Mezei02e5d432022-10-03 16:45:11 +0200378
379mbedtls_mpi_mod_raw_cond_swap: copy half of the limbs
Gabor Mezeia67a1a32022-10-10 15:25:59 +0200380mpi_mod_raw_cond_swap:"00000000FFFFFFFF55555555AAAAAAAA":"FEDCBA9876543210FEDCBA9876543210":8
Gabor Mezeib27b1c52022-09-12 16:36:48 +0200381
Janos Follath0e5532d2019-10-11 14:21:53 +0100382Base test mbedtls_mpi_lt_mpi_ct #1
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100383mpi_lt_mpi_ct:1:"2B5":1:"2B5":0:0
Janos Follath385d5b82019-09-11 16:07:14 +0100384
Janos Follath0e5532d2019-10-11 14:21:53 +0100385Base test mbedtls_mpi_lt_mpi_ct #2
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100386mpi_lt_mpi_ct:1:"2B5":1:"2B4":0:0
Janos Follath385d5b82019-09-11 16:07:14 +0100387
Janos Follath0e5532d2019-10-11 14:21:53 +0100388Base test mbedtls_mpi_lt_mpi_ct #3
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100389mpi_lt_mpi_ct:1:"2B5":1:"2B6":1:0
Janos Follath385d5b82019-09-11 16:07:14 +0100390
Janos Follath0e5532d2019-10-11 14:21:53 +0100391Base test mbedtls_mpi_lt_mpi_ct (Negative values) #1
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100392mpi_lt_mpi_ct:1:"-2":1:"-2":0:0
Janos Follath385d5b82019-09-11 16:07:14 +0100393
Janos Follath0e5532d2019-10-11 14:21:53 +0100394Base test mbedtls_mpi_lt_mpi_ct (Negative values) #2
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100395mpi_lt_mpi_ct:1:"-2":1:"-3":0:0
Janos Follath385d5b82019-09-11 16:07:14 +0100396
Janos Follath0e5532d2019-10-11 14:21:53 +0100397Base test mbedtls_mpi_lt_mpi_ct (Negative values) #3
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100398mpi_lt_mpi_ct:1:"-2":1:"-1":1:0
Janos Follath385d5b82019-09-11 16:07:14 +0100399
Janos Follath53fc7b02019-11-05 11:56:07 +0000400Base test mbedtls_mpi_lt_mpi_ct (Mixed values) #1
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100401mpi_lt_mpi_ct:1:"-3":1:"2":1:0
Janos Follath385d5b82019-09-11 16:07:14 +0100402
Janos Follath53fc7b02019-11-05 11:56:07 +0000403Base test mbedtls_mpi_lt_mpi_ct (Mixed values) #2
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100404mpi_lt_mpi_ct:1:"2":1:"-3":0:0
Janos Follath385d5b82019-09-11 16:07:14 +0100405
Janos Follath53fc7b02019-11-05 11:56:07 +0000406Base test mbedtls_mpi_lt_mpi_ct (Mixed values) #3
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100407mpi_lt_mpi_ct:2:"-2":2:"1C67967269C6":1:0
Janos Follath385d5b82019-09-11 16:07:14 +0100408
Janos Follath53fc7b02019-11-05 11:56:07 +0000409Base test mbedtls_mpi_lt_mpi_ct (X is longer in storage)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100410mpi_lt_mpi_ct:3:"2B5":2:"2B5":0:MBEDTLS_ERR_MPI_BAD_INPUT_DATA
Janos Follath385d5b82019-09-11 16:07:14 +0100411
Janos Follath53fc7b02019-11-05 11:56:07 +0000412Base test mbedtls_mpi_lt_mpi_ct (Y is longer in storage)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100413mpi_lt_mpi_ct:3:"2B5":4:"2B5":0:MBEDTLS_ERR_MPI_BAD_INPUT_DATA
Janos Follath385d5b82019-09-11 16:07:14 +0100414
Gilles Peskine36374882021-06-08 23:01:13 +0200415Base test mbedtls_mpi_lt_mpi_ct (length=0)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100416mpi_lt_mpi_ct:0:"":0:"":0:0
Gilles Peskine36374882021-06-08 23:01:13 +0200417
Janos Follathf17c8002019-10-29 15:05:12 +0000418Base test mbedtls_mpi_lt_mpi_ct (corner case - 64 bit) #1
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100419mpi_lt_mpi_ct:2:"7FFFFFFFFFFFFFFF":2:"FF":0:0
Janos Follath0ac95572019-10-14 11:33:39 +0100420
Janos Follathf17c8002019-10-29 15:05:12 +0000421Base test mbedtls_mpi_lt_mpi_ct (corner case - 64 bit) #2
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100422mpi_lt_mpi_ct:2:"8000000000000000":2:"7FFFFFFFFFFFFFFF":0:0
Janos Follath0ac95572019-10-14 11:33:39 +0100423
Janos Follathf17c8002019-10-29 15:05:12 +0000424Base test mbedtls_mpi_lt_mpi_ct (corner case - 64 bit) #3
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100425mpi_lt_mpi_ct:2:"8000000000000000":2:"1":0:0
Janos Follath0ac95572019-10-14 11:33:39 +0100426
Janos Follathf17c8002019-10-29 15:05:12 +0000427Base test mbedtls_mpi_lt_mpi_ct (corner case - 64 bit) #4
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100428mpi_lt_mpi_ct:2:"8000000000000000":2:"0":0:0
Janos Follath0ac95572019-10-14 11:33:39 +0100429
Janos Follathf17c8002019-10-29 15:05:12 +0000430Base test mbedtls_mpi_lt_mpi_ct (corner case - 64 bit) #5
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100431mpi_lt_mpi_ct:2:"FFFFFFFFFFFFFFFF":2:"FF":0:0
Janos Follath0ac95572019-10-14 11:33:39 +0100432
Janos Follathf17c8002019-10-29 15:05:12 +0000433Base test mbedtls_mpi_lt_mpi_ct (corner case - 32 bit) #1
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100434mpi_lt_mpi_ct:1:"7FFFFFFF":1:"FF":0:0
Janos Follathf17c8002019-10-29 15:05:12 +0000435
436Base test mbedtls_mpi_lt_mpi_ct (corner case - 32 bit) #2
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100437mpi_lt_mpi_ct:1:"80000000":1:"7FFFFFFF":0:0
Janos Follathf17c8002019-10-29 15:05:12 +0000438
439Base test mbedtls_mpi_lt_mpi_ct (corner case - 32 bit) #3
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100440mpi_lt_mpi_ct:1:"80000000":1:"1":0:0
Janos Follathf17c8002019-10-29 15:05:12 +0000441
442Base test mbedtls_mpi_lt_mpi_ct (corner case - 32 bit) #4
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100443mpi_lt_mpi_ct:1:"80000000":1:"0":0:0
Janos Follathf17c8002019-10-29 15:05:12 +0000444
445Base test mbedtls_mpi_lt_mpi_ct (corner case - 32 bit) #5
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100446mpi_lt_mpi_ct:1:"FFFFFFFF":1:"FF":0:0
Janos Follathf17c8002019-10-29 15:05:12 +0000447
Janos Follath53fc7b02019-11-05 11:56:07 +0000448Multi-limb mbedtls_mpi_lt_mpi_ct (X<Y, zero vs non-zero MS limb)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100449mpi_lt_mpi_ct:2:"0FFFFFFFFFFFFFFFF":2:"1FFFFFFFFFFFFFFFF":1:0
Janos Follath0ac95572019-10-14 11:33:39 +0100450
Janos Follath53fc7b02019-11-05 11:56:07 +0000451Multi-limb mbedtls_mpi_lt_mpi_ct (X>Y, equal MS limbs)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100452mpi_lt_mpi_ct:2:"-EEFFFFFFFFFFFFFFF1":2:"-EEFFFFFFFFFFFFFFFF":0:0
Janos Follath0ac95572019-10-14 11:33:39 +0100453
Janos Follath53fc7b02019-11-05 11:56:07 +0000454Multi-limb mbedtls_mpi_lt_mpi_ct (X=Y)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100455mpi_lt_mpi_ct:2:"EEFFFFFFFFFFFFFFFF":2:"EEFFFFFFFFFFFFFFFF":0:0
Janos Follath0ac95572019-10-14 11:33:39 +0100456
Janos Follath53fc7b02019-11-05 11:56:07 +0000457Multi-limb mbedtls_mpi_lt_mpi_ct (X=-Y)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100458mpi_lt_mpi_ct:2:"-EEFFFFFFFFFFFFFFFF":2:"EEFFFFFFFFFFFFFFFF":1:0
Janos Follath0ac95572019-10-14 11:33:39 +0100459
Janos Follath0b1ae0e2019-11-05 12:19:14 +0000460Multi-limb mbedtls_mpi_lt_mpi_ct (Alternating limbs) #1
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100461mpi_lt_mpi_ct:2:"11FFFFFFFFFFFFFFFF":2:"FF1111111111111111":1:0
Janos Follath0b1ae0e2019-11-05 12:19:14 +0000462
463Multi-limb mbedtls_mpi_lt_mpi_ct (Alternating limbs) #2
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100464mpi_lt_mpi_ct:2:"FF1111111111111111":2:"11FFFFFFFFFFFFFFFF":0:0
Janos Follath0b1ae0e2019-11-05 12:19:14 +0000465
466Multi-limb mbedtls_mpi_lt_mpi_ct (Alternating limbs) #3
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100467mpi_lt_mpi_ct:2:"-11FFFFFFFFFFFFFFFF":2:"-FF1111111111111111":0:0
Janos Follath0b1ae0e2019-11-05 12:19:14 +0000468
469Multi-limb mbedtls_mpi_lt_mpi_ct (Alternating limbs) #4
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100470mpi_lt_mpi_ct:2:"-FF1111111111111111":2:"-11FFFFFFFFFFFFFFFF":1:0
Janos Follath0b1ae0e2019-11-05 12:19:14 +0000471
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200472Base test mbedtls_mpi_cmp_abs #1
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100473mpi_cmp_abs:"2b5":"2b5":0
Paul Bakker367dae42009-06-28 21:50:27 +0000474
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200475Base test mbedtls_mpi_cmp_abs #2
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100476mpi_cmp_abs:"2b5":"2b4":1
Paul Bakker367dae42009-06-28 21:50:27 +0000477
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200478Base test mbedtls_mpi_cmp_abs #3
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100479mpi_cmp_abs:"2b5":"2b6":-1
Paul Bakker367dae42009-06-28 21:50:27 +0000480
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200481Base test mbedtls_mpi_cmp_abs (Negative values) #1
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100482mpi_cmp_abs:"-2":"-2":0
Paul Bakker367dae42009-06-28 21:50:27 +0000483
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200484Base test mbedtls_mpi_cmp_abs (Negative values) #2
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100485mpi_cmp_abs:"-2":"-3":-1
Paul Bakker367dae42009-06-28 21:50:27 +0000486
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200487Base test mbedtls_mpi_cmp_abs (Negative values) #3
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100488mpi_cmp_abs:"-2":"-1":1
Paul Bakker367dae42009-06-28 21:50:27 +0000489
Gilles Peskine36374882021-06-08 23:01:13 +0200490Test mbedtls_mpi_cmp_abs: 0 (null) = 0 (null)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100491mpi_cmp_abs:"":"":0
Gilles Peskine36374882021-06-08 23:01:13 +0200492
493Test mbedtls_mpi_cmp_abs: 0 (null) = 0 (1 limb)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100494mpi_cmp_abs:"":"0":0
Gilles Peskine36374882021-06-08 23:01:13 +0200495
496Test mbedtls_mpi_cmp_abs: 0 (1 limb) = 0 (null)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100497mpi_cmp_abs:"0":"":0
Gilles Peskine36374882021-06-08 23:01:13 +0200498
Gilles Peskine5fb6f702021-06-08 23:00:17 +0200499Test mbedtls_mpi_cmp_abs: 0 (1 limb) = 0 (1 limb)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100500mpi_cmp_abs:"0":"0":0
Paul Bakkerba48cb22009-07-12 11:01:32 +0000501
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200502Base test mbedtls_mpi_cmp_abs (Mix values) #1
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100503mpi_cmp_abs:"-2":"2":0
Paul Bakker367dae42009-06-28 21:50:27 +0000504
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200505Base test mbedtls_mpi_cmp_abs (Mix values) #2
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100506mpi_cmp_abs:"2":"-3":-1
Paul Bakker367dae42009-06-28 21:50:27 +0000507
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200508Base test mbedtls_mpi_cmp_abs (Mix values) #3
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100509mpi_cmp_abs:"-2":"1":1
Paul Bakker367dae42009-06-28 21:50:27 +0000510
Gilles Peskine90ec8e82021-06-10 15:17:30 +0200511Copy large negative to large negative
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100512mpi_copy:"-ca5cadedb01dfaceacc01ade":"-face1e55ca11ab1ecab005e5"
Paul Bakker367dae42009-06-28 21:50:27 +0000513
Gilles Peskine90ec8e82021-06-10 15:17:30 +0200514Copy large negative to large positive
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100515mpi_copy:"-ca5cadedb01dfaceacc01ade":"face1e55ca11ab1ecab005e5"
Gilles Peskine7428b452020-01-20 21:01:51 +0100516
Gilles Peskine90ec8e82021-06-10 15:17:30 +0200517Copy large negative to small negative
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100518mpi_copy:"-ca5cadedb01dfaceacc01ade":"-beef"
Gilles Peskine7428b452020-01-20 21:01:51 +0100519
Gilles Peskine90ec8e82021-06-10 15:17:30 +0200520Copy large negative to small positive
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100521mpi_copy:"-ca5cadedb01dfaceacc01ade":"beef"
Gilles Peskine7428b452020-01-20 21:01:51 +0100522
Gilles Peskine90ec8e82021-06-10 15:17:30 +0200523Copy large negative to zero (1 limb)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100524mpi_copy:"-ca5cadedb01dfaceacc01ade":"0"
Gilles Peskine7428b452020-01-20 21:01:51 +0100525
Gilles Peskine90ec8e82021-06-10 15:17:30 +0200526Copy large negative to zero (null)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100527mpi_copy:"-ca5cadedb01dfaceacc01ade":""
Gilles Peskine90ec8e82021-06-10 15:17:30 +0200528
529Copy large positive to large negative
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100530mpi_copy:"ca5cadedb01dfaceacc01ade":"-face1e55ca11ab1ecab005e5"
Gilles Peskine90ec8e82021-06-10 15:17:30 +0200531
532Copy large positive to large positive
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100533mpi_copy:"ca5cadedb01dfaceacc01ade":"face1e55ca11ab1ecab005e5"
Gilles Peskine90ec8e82021-06-10 15:17:30 +0200534
535Copy large positive to small negative
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100536mpi_copy:"ca5cadedb01dfaceacc01ade":"-beef"
Gilles Peskine90ec8e82021-06-10 15:17:30 +0200537
538Copy large positive to small positive
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100539mpi_copy:"ca5cadedb01dfaceacc01ade":"beef"
Gilles Peskine90ec8e82021-06-10 15:17:30 +0200540
541Copy large positive to zero (1 limb)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100542mpi_copy:"ca5cadedb01dfaceacc01ade":"0"
Gilles Peskine90ec8e82021-06-10 15:17:30 +0200543
544Copy large positive to zero (null)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100545mpi_copy:"ca5cadedb01dfaceacc01ade":""
Gilles Peskine90ec8e82021-06-10 15:17:30 +0200546
547Copy small negative to large negative
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100548mpi_copy:"-bead":"-face1e55ca11ab1ecab005e5"
Gilles Peskine90ec8e82021-06-10 15:17:30 +0200549
550Copy small negative to large positive
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100551mpi_copy:"-bead":"face1e55ca11ab1ecab005e5"
Gilles Peskine90ec8e82021-06-10 15:17:30 +0200552
553Copy small negative to small negative
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100554mpi_copy:"-bead":"-beef"
Gilles Peskine90ec8e82021-06-10 15:17:30 +0200555
556Copy small negative to small positive
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100557mpi_copy:"-bead":"beef"
Gilles Peskine90ec8e82021-06-10 15:17:30 +0200558
559Copy small negative to zero (1 limb)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100560mpi_copy:"-bead":"0"
Gilles Peskine90ec8e82021-06-10 15:17:30 +0200561
562Copy small negative to zero (null)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100563mpi_copy:"-bead":""
Gilles Peskine90ec8e82021-06-10 15:17:30 +0200564
565Copy small positive to large negative
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100566mpi_copy:"bead":"-face1e55ca11ab1ecab005e5"
Gilles Peskine90ec8e82021-06-10 15:17:30 +0200567
568Copy small positive to large positive
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100569mpi_copy:"bead":"face1e55ca11ab1ecab005e5"
Gilles Peskine90ec8e82021-06-10 15:17:30 +0200570
571Copy small positive to small negative
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100572mpi_copy:"bead":"-beef"
Gilles Peskine90ec8e82021-06-10 15:17:30 +0200573
574Copy small positive to small positive
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100575mpi_copy:"bead":"beef"
Gilles Peskine90ec8e82021-06-10 15:17:30 +0200576
577Copy small positive to zero (1 limb)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100578mpi_copy:"bead":"0"
Gilles Peskine90ec8e82021-06-10 15:17:30 +0200579
580Copy small positive to zero (null)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100581mpi_copy:"bead":""
Gilles Peskine90ec8e82021-06-10 15:17:30 +0200582
583Copy zero (1 limb) to large negative
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100584mpi_copy:"0":"-face1e55ca11ab1ecab005e5"
Gilles Peskine90ec8e82021-06-10 15:17:30 +0200585
586Copy zero (1 limb) to large positive
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100587mpi_copy:"0":"face1e55ca11ab1ecab005e5"
Gilles Peskine90ec8e82021-06-10 15:17:30 +0200588
589Copy zero (1 limb) to small negative
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100590mpi_copy:"0":"-beef"
Gilles Peskine90ec8e82021-06-10 15:17:30 +0200591
592Copy zero (1 limb) to small positive
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100593mpi_copy:"0":"beef"
Gilles Peskine90ec8e82021-06-10 15:17:30 +0200594
595Copy zero (1 limb) to zero (1 limb)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100596mpi_copy:"0":"0"
Gilles Peskine90ec8e82021-06-10 15:17:30 +0200597
598Copy zero (1 limb) to zero (null)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100599mpi_copy:"0":""
Gilles Peskine90ec8e82021-06-10 15:17:30 +0200600
601Copy zero (null) to large negative
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100602mpi_copy:"":"-face1e55ca11ab1ecab005e5"
Gilles Peskine90ec8e82021-06-10 15:17:30 +0200603
604Copy zero (null) to large positive
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100605mpi_copy:"":"face1e55ca11ab1ecab005e5"
Gilles Peskine90ec8e82021-06-10 15:17:30 +0200606
607Copy zero (null) to small negative
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100608mpi_copy:"":"-beef"
Gilles Peskine90ec8e82021-06-10 15:17:30 +0200609
610Copy zero (null) to small positive
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100611mpi_copy:"":"beef"
Gilles Peskine90ec8e82021-06-10 15:17:30 +0200612
613Copy zero (null) to zero (1 limb)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100614mpi_copy:"":"0"
Gilles Peskine7428b452020-01-20 21:01:51 +0100615
616Copy zero (null) to zero (null)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100617mpi_copy:"":""
Gilles Peskine7428b452020-01-20 21:01:51 +0100618
Gilles Peskine90ec8e82021-06-10 15:17:30 +0200619Copy self: large negative
620mpi_copy_self:"-ca5cadedb01dfaceacc01ade"
Gilles Peskine7428b452020-01-20 21:01:51 +0100621
Gilles Peskine90ec8e82021-06-10 15:17:30 +0200622Copy self: large positive
623mpi_copy_self:"ca5cadedb01dfaceacc01ade"
Gilles Peskine7428b452020-01-20 21:01:51 +0100624
Gilles Peskine90ec8e82021-06-10 15:17:30 +0200625Copy self: small negative
626mpi_copy_self:"-bead"
Gilles Peskine7428b452020-01-20 21:01:51 +0100627
Gilles Peskine90ec8e82021-06-10 15:17:30 +0200628Copy self: small positive
629mpi_copy_self:"bead"
Paul Bakkere896fea2009-07-06 06:40:23 +0000630
Gilles Peskine7428b452020-01-20 21:01:51 +0100631Copy self: zero (1 limb)
Gilles Peskine90ec8e82021-06-10 15:17:30 +0200632mpi_copy_self:"0"
633
634Copy self: zero (null)
635mpi_copy_self:""
Paul Bakker367dae42009-06-28 21:50:27 +0000636
Gilles Peskinefc1eeef2021-06-10 22:29:57 +0200637Swap large negative with large negative
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100638mpi_swap:"-ca5cadedb01dfaceacc01ade":"-face1e55ca11ab1ecab005e5"
Gilles Peskine7428b452020-01-20 21:01:51 +0100639
Gilles Peskinefc1eeef2021-06-10 22:29:57 +0200640Swap large negative with large positive
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100641mpi_swap:"-ca5cadedb01dfaceacc01ade":"face1e55ca11ab1ecab005e5"
Gilles Peskine7428b452020-01-20 21:01:51 +0100642
Gilles Peskinefc1eeef2021-06-10 22:29:57 +0200643Swap large negative with small negative
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100644mpi_swap:"-ca5cadedb01dfaceacc01ade":"-beef"
Gilles Peskine7428b452020-01-20 21:01:51 +0100645
Gilles Peskinefc1eeef2021-06-10 22:29:57 +0200646Swap large negative with small positive
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100647mpi_swap:"-ca5cadedb01dfaceacc01ade":"beef"
Gilles Peskine7428b452020-01-20 21:01:51 +0100648
Gilles Peskinefc1eeef2021-06-10 22:29:57 +0200649Swap large negative with zero (1 limb)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100650mpi_swap:"-ca5cadedb01dfaceacc01ade":"0"
Gilles Peskine7428b452020-01-20 21:01:51 +0100651
Gilles Peskinefc1eeef2021-06-10 22:29:57 +0200652Swap large negative with zero (null)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100653mpi_swap:"-ca5cadedb01dfaceacc01ade":""
Gilles Peskinefc1eeef2021-06-10 22:29:57 +0200654
655Swap large positive with large negative
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100656mpi_swap:"ca5cadedb01dfaceacc01ade":"-face1e55ca11ab1ecab005e5"
Gilles Peskinefc1eeef2021-06-10 22:29:57 +0200657
658Swap large positive with large positive
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100659mpi_swap:"ca5cadedb01dfaceacc01ade":"face1e55ca11ab1ecab005e5"
Gilles Peskinefc1eeef2021-06-10 22:29:57 +0200660
661Swap large positive with small negative
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100662mpi_swap:"ca5cadedb01dfaceacc01ade":"-beef"
Gilles Peskinefc1eeef2021-06-10 22:29:57 +0200663
664Swap large positive with small positive
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100665mpi_swap:"ca5cadedb01dfaceacc01ade":"beef"
Gilles Peskinefc1eeef2021-06-10 22:29:57 +0200666
667Swap large positive with zero (1 limb)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100668mpi_swap:"ca5cadedb01dfaceacc01ade":"0"
Gilles Peskinefc1eeef2021-06-10 22:29:57 +0200669
670Swap large positive with zero (null)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100671mpi_swap:"ca5cadedb01dfaceacc01ade":""
Gilles Peskinefc1eeef2021-06-10 22:29:57 +0200672
673Swap small negative with large negative
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100674mpi_swap:"-bead":"-face1e55ca11ab1ecab005e5"
Gilles Peskinefc1eeef2021-06-10 22:29:57 +0200675
676Swap small negative with large positive
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100677mpi_swap:"-bead":"face1e55ca11ab1ecab005e5"
Gilles Peskinefc1eeef2021-06-10 22:29:57 +0200678
679Swap small negative with small negative
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100680mpi_swap:"-bead":"-beef"
Gilles Peskinefc1eeef2021-06-10 22:29:57 +0200681
682Swap small negative with small positive
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100683mpi_swap:"-bead":"beef"
Gilles Peskinefc1eeef2021-06-10 22:29:57 +0200684
685Swap small negative with zero (1 limb)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100686mpi_swap:"-bead":"0"
Gilles Peskinefc1eeef2021-06-10 22:29:57 +0200687
688Swap small negative with zero (null)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100689mpi_swap:"-bead":""
Gilles Peskinefc1eeef2021-06-10 22:29:57 +0200690
691Swap small positive with large negative
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100692mpi_swap:"bead":"-face1e55ca11ab1ecab005e5"
Gilles Peskinefc1eeef2021-06-10 22:29:57 +0200693
694Swap small positive with large positive
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100695mpi_swap:"bead":"face1e55ca11ab1ecab005e5"
Gilles Peskinefc1eeef2021-06-10 22:29:57 +0200696
697Swap small positive with small negative
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100698mpi_swap:"bead":"-beef"
Gilles Peskinefc1eeef2021-06-10 22:29:57 +0200699
700Swap small positive with small positive
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100701mpi_swap:"bead":"beef"
Gilles Peskinefc1eeef2021-06-10 22:29:57 +0200702
703Swap small positive with zero (1 limb)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100704mpi_swap:"bead":"0"
Gilles Peskinefc1eeef2021-06-10 22:29:57 +0200705
706Swap small positive with zero (null)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100707mpi_swap:"bead":""
Gilles Peskinefc1eeef2021-06-10 22:29:57 +0200708
709Swap zero (1 limb) with large negative
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100710mpi_swap:"0":"-face1e55ca11ab1ecab005e5"
Gilles Peskinefc1eeef2021-06-10 22:29:57 +0200711
712Swap zero (1 limb) with large positive
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100713mpi_swap:"0":"face1e55ca11ab1ecab005e5"
Gilles Peskinefc1eeef2021-06-10 22:29:57 +0200714
715Swap zero (1 limb) with small negative
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100716mpi_swap:"0":"-beef"
Gilles Peskinefc1eeef2021-06-10 22:29:57 +0200717
718Swap zero (1 limb) with small positive
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100719mpi_swap:"0":"beef"
Gilles Peskinefc1eeef2021-06-10 22:29:57 +0200720
721Swap zero (1 limb) with zero (1 limb)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100722mpi_swap:"0":"0"
Gilles Peskinefc1eeef2021-06-10 22:29:57 +0200723
724Swap zero (1 limb) with zero (null)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100725mpi_swap:"0":""
Gilles Peskinefc1eeef2021-06-10 22:29:57 +0200726
727Swap zero (null) with large negative
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100728mpi_swap:"":"-face1e55ca11ab1ecab005e5"
Gilles Peskinefc1eeef2021-06-10 22:29:57 +0200729
730Swap zero (null) with large positive
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100731mpi_swap:"":"face1e55ca11ab1ecab005e5"
Gilles Peskinefc1eeef2021-06-10 22:29:57 +0200732
733Swap zero (null) with small negative
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100734mpi_swap:"":"-beef"
Gilles Peskinefc1eeef2021-06-10 22:29:57 +0200735
736Swap zero (null) with small positive
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100737mpi_swap:"":"beef"
Gilles Peskinefc1eeef2021-06-10 22:29:57 +0200738
739Swap zero (null) with zero (1 limb)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100740mpi_swap:"":"0"
Gilles Peskine7428b452020-01-20 21:01:51 +0100741
742Swap zero (null) with zero (null)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100743mpi_swap:"":""
Gilles Peskine7428b452020-01-20 21:01:51 +0100744
Gilles Peskinefc1eeef2021-06-10 22:29:57 +0200745Swap self: large negative
746mpi_swap_self:"-ca5cadedb01dfaceacc01ade"
Gilles Peskine7428b452020-01-20 21:01:51 +0100747
Gilles Peskinefc1eeef2021-06-10 22:29:57 +0200748Swap self: large positive
749mpi_swap_self:"ca5cadedb01dfaceacc01ade"
Gilles Peskine7428b452020-01-20 21:01:51 +0100750
Gilles Peskinefc1eeef2021-06-10 22:29:57 +0200751Swap self: small negative
752mpi_swap_self:"-bead"
Gilles Peskine7428b452020-01-20 21:01:51 +0100753
Gilles Peskinefc1eeef2021-06-10 22:29:57 +0200754Swap self: small positive
755mpi_swap_self:"bead"
Gilles Peskine7428b452020-01-20 21:01:51 +0100756
Gilles Peskinefc1eeef2021-06-10 22:29:57 +0200757Swap self: zero (1 limb)
758mpi_swap_self:"0"
Gilles Peskine7428b452020-01-20 21:01:51 +0100759
Gilles Peskinefc1eeef2021-06-10 22:29:57 +0200760Swap self: zero (null)
Gilles Peskine7428b452020-01-20 21:01:51 +0100761mpi_swap_self:""
Paul Bakker367dae42009-06-28 21:50:27 +0000762
Gilles Peskine36374882021-06-08 23:01:13 +0200763Shrink 0 limbs in a buffer of size 0 to 0
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100764mpi_shrink:0:0:0:0
Gilles Peskine36374882021-06-08 23:01:13 +0200765
Gilles Peskinea9da0932020-02-03 16:18:30 +0100766Shrink 2 limbs in a buffer of size 2 to 4
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100767mpi_shrink:2:2:4:4
Manuel Pégourié-Gonnard58681632013-11-21 10:39:37 +0100768
Gilles Peskinea9da0932020-02-03 16:18:30 +0100769Shrink 2 limbs in a buffer of size 4 to 4
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100770mpi_shrink:4:2:4:4
Manuel Pégourié-Gonnard58681632013-11-21 10:39:37 +0100771
Gilles Peskinea9da0932020-02-03 16:18:30 +0100772Shrink 2 limbs in a buffer of size 8 to 4
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100773mpi_shrink:8:2:4:4
Manuel Pégourié-Gonnard58681632013-11-21 10:39:37 +0100774
Gilles Peskinea9da0932020-02-03 16:18:30 +0100775Shrink 4 limbs in a buffer of size 8 to 4
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100776mpi_shrink:8:4:4:4
Manuel Pégourié-Gonnard58681632013-11-21 10:39:37 +0100777
Gilles Peskinea9da0932020-02-03 16:18:30 +0100778Shrink 6 limbs in a buffer of size 8 to 4 yielding 6
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100779mpi_shrink:8:6:4:6
Manuel Pégourié-Gonnard58681632013-11-21 10:39:37 +0100780
Gilles Peskinea9da0932020-02-03 16:18:30 +0100781Shrink 2 limbs in a buffer of size 4 to 0 yielding 2
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100782mpi_shrink:4:2:0:2
Manuel Pégourié-Gonnard58681632013-11-21 10:39:37 +0100783
Gilles Peskinea9da0932020-02-03 16:18:30 +0100784Shrink 1 limbs in a buffer of size 4 to 0 yielding 1
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100785mpi_shrink:4:1:0:1
Manuel Pégourié-Gonnard58681632013-11-21 10:39:37 +0100786
Gilles Peskinea9da0932020-02-03 16:18:30 +0100787Shrink 0 limbs in a buffer of size 4 to 0 yielding 1
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100788mpi_shrink:4:0:0:1
Manuel Pégourié-Gonnard58681632013-11-21 10:39:37 +0100789
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200790Base test mbedtls_mpi_add_abs #1
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100791mpi_add_abs:"bc614e":"9cde3":"c62f31"
Paul Bakker367dae42009-06-28 21:50:27 +0000792
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200793Base test mbedtls_mpi_add_abs #2
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100794mpi_add_abs:"-bc614e":"9cde3":"c62f31"
Paul Bakker367dae42009-06-28 21:50:27 +0000795
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200796Base test mbedtls_mpi_add_abs #3
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100797mpi_add_abs:"bc614e":"-9cde3":"c62f31"
Paul Bakker367dae42009-06-28 21:50:27 +0000798
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200799Base test mbedtls_mpi_add_abs #4
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100800mpi_add_abs:"-bc614e":"-9cde3":"c62f31"
Paul Bakker367dae42009-06-28 21:50:27 +0000801
Gilles Peskine89987702021-06-15 22:03:37 +0200802Test mbedtls_mpi_add_abs: 0 (null) + 0 (null)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100803mpi_add_abs:"":"":"0"
Gilles Peskine36374882021-06-08 23:01:13 +0200804
Gilles Peskine89987702021-06-15 22:03:37 +0200805Test mbedtls_mpi_add_abs: 0 (null) + 1
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100806mpi_add_abs:"":"01":"01"
Gilles Peskine36374882021-06-08 23:01:13 +0200807
Gilles Peskine89987702021-06-15 22:03:37 +0200808Test mbedtls_mpi_add_abs: 1 + 0 (null)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100809mpi_add_abs:"01":"":"01"
Gilles Peskine36374882021-06-08 23:01:13 +0200810
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200811Test mbedtls_mpi_add_abs #1
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100812mpi_add_abs:"-1f55332c3a48b910f9942f6c914e58bef37a47ee45cb164a5b6b8d1006bf59a059c21449939ebebfdf517d2e1dbac88010d7b1f141e997bd6801ddaec9d05910f4f2de2b2c4d714e2c14a72fc7f17aa428d59c531627f09":"941379d00fed1491dec0abfc13b52b9049625b3c42c3a972a2549e7a3e1b12c5a304b23e9ed6e251b8af28a4b3124900b23138bfafda925ab3410d57d6f8f0dd8c8c32eb0b4329fbf792e43f9593e766fa0c3c0be077b4e5162616a6428c51b":"941379d00fed1491fe15df284dfde4a142f68aa8d412023195cee66883e6290ffe703f4ea5963bf212713cee46b107c09182b5edcd955adac418bf4918e2889af48e1099d513830cec85c26ac1e158b52620e33ba8692f893efbb2f958b4424"
Paul Bakker367dae42009-06-28 21:50:27 +0000813
Gilles Peskineefa2ac82019-09-19 21:20:26 +0200814Regression mbedtls_mpi_add_abs (add small to very large MPI with carry rollover) [#1]
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100815mpi_add_abs:"FFFFFFFFFFFFFFFFFFFFFFFFFFFFF8":"08":"1000000000000000000000000000000"
Paul Bakker17a97902012-09-17 08:44:35 +0000816
Gilles Peskineefa2ac82019-09-19 21:20:26 +0200817Regression mbedtls_mpi_add_abs (add small to very large MPI with carry rollover) [#2]
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100818mpi_add_abs:"08":"FFFFFFFFFFFFFFFFFFFFFFFFFFFFF8":"1000000000000000000000000000000"
Paul Bakker17a97902012-09-17 08:44:35 +0000819
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200820Base test mbedtls_mpi_add_mpi #1
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100821mpi_add_mpi:"bc614e":"9cde3":"c62f31"
Paul Bakker367dae42009-06-28 21:50:27 +0000822
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200823Base test mbedtls_mpi_add_mpi #2
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100824mpi_add_mpi:"-bc614e":"9cde3":"-b2936b"
Paul Bakker367dae42009-06-28 21:50:27 +0000825
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200826Base test mbedtls_mpi_add_mpi #3
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100827mpi_add_mpi:"bc614e":"-9cde3":"b2936b"
Paul Bakker367dae42009-06-28 21:50:27 +0000828
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200829Base test mbedtls_mpi_add_mpi #4
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100830mpi_add_mpi:"-bc614e":"-9cde3":"-c62f31"
Paul Bakker367dae42009-06-28 21:50:27 +0000831
Gilles Peskine89987702021-06-15 22:03:37 +0200832Test mbedtls_mpi_add_mpi: 0 (null) + 0 (null)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100833mpi_add_mpi:"":"":"0"
Gilles Peskine36374882021-06-08 23:01:13 +0200834
Gilles Peskine89987702021-06-15 22:03:37 +0200835Test mbedtls_mpi_add_mpi: 0 (null) + 1
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100836mpi_add_mpi:"":"01":"01"
Gilles Peskine36374882021-06-08 23:01:13 +0200837
Gilles Peskine89987702021-06-15 22:03:37 +0200838Test mbedtls_mpi_add_mpi: 1 + 0 (null)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100839mpi_add_mpi:"01":"":"01"
Gilles Peskine36374882021-06-08 23:01:13 +0200840
Gilles Peskine89987702021-06-15 22:03:37 +0200841Test mbedtls_mpi_add_mpi: 0 (null) + -1
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100842mpi_add_mpi:"":"-01":"-01"
Gilles Peskine36374882021-06-08 23:01:13 +0200843
Gilles Peskine89987702021-06-15 22:03:37 +0200844Test mbedtls_mpi_add_mpi: -1 + 0 (null)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100845mpi_add_mpi:"-01":"":"-01"
Gilles Peskine36374882021-06-08 23:01:13 +0200846
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200847Test mbedtls_mpi_add_mpi #1
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100848mpi_add_mpi:"4df72d07b4b71c8dacb6cffa954f8d88254b6277099308baf003fab73227f34029643b5a263f66e0d3c3fa297ef71755efd53b8fb6cb812c6bbf7bcf179298bd9947c4c8b14324140a2c0f5fad7958a69050a987a6096e9f055fb38edf0c5889eca4a0cfa99b45fbdeee4c696b328ddceae4723945901ec025076b12b":"cb50e82a8583f44ee0025942e7362991b24e12663a0ddc234a57b0f7b4ff7b025bf5a6707dedc2898e70b739042c95a996283dffdf67558768784553c61e302e8812bc90f0bb0696870cfb910b560cefed8d99bbf7a00b31ccdbd56f3594e5a653cfd127d2167b13119e5c45c3f76b4e3d904a9bc0cbb43c33aa7f23b":"1194815323a3b10dc8cb9293d7c85b719d79974dd43a0e4de3a5babaee7276e428559e1caa42d296a6234b1628323acff85fd798f9632d6b3d437c122ddb0c8ec215a8159a1fe2aaa91390af0b8cf65967dde43439da979d0d23b88fe14a13e30407471f77bb1c10ef08ca8af2f29f92b2874bcd5065bd2fc58b1ea366"
Paul Bakker367dae42009-06-28 21:50:27 +0000849
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200850Test mbedtls_mpi_add_mpi #2
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100851mpi_add_mpi:"1f55332c3a48b910f9942f6c914e58bef37a47ee45cb164a5b6b8d1006bf59a059c21449939ebebfdf517d2e1dbac88010d7b1f141e997bd6801ddaec9d05910f4f2de2b2c4d714e2c14a72fc7f17aa428d59c531627f09":"941379d00fed1491dec0abfc13b52b9049625b3c42c3a972a2549e7a3e1b12c5a304b23e9ed6e251b8af28a4b3124900b23138bfafda925ab3410d57d6f8f0dd8c8c32eb0b4329fbf792e43f9593e766fa0c3c0be077b4e5162616a6428c51b":"941379d00fed1491fe15df284dfde4a142f68aa8d412023195cee66883e6290ffe703f4ea5963bf212713cee46b107c09182b5edcd955adac418bf4918e2889af48e1099d513830cec85c26ac1e158b52620e33ba8692f893efbb2f958b4424"
Paul Bakker367dae42009-06-28 21:50:27 +0000852
Janos Follath044a86b2015-10-25 10:58:03 +0100853Base test mbedtls_mpi_add_mpi inplace #1
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100854mpi_add_mpi_inplace:"bc614e":"178c29c"
Janos Follath044a86b2015-10-25 10:58:03 +0100855
Darryl Green11999bb2018-03-13 15:22:58 +0000856Test mbedtls_mpi_add_mpi inplace #2
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100857mpi_add_mpi_inplace:"1f55332c3a48b910f9942f6c914e58bef37a47ee45cb164a5b6b8d1006bf59a059c21449939ebebfdf517d2e1dbac88010d7b1f141e997bd6801ddaec9d05910f4f2de2b2c4d714e2c14a72fc7f17aa428d59c531627f09":"3eaa665874917221f3285ed9229cb17de6f48fdc8b962c94b6d71a200d7eb340b3842893273d7d7fbea2fa5c3b75910021af63e283d32f7ad003bb5d93a0b221e9e5bc56589ae29c58294e5f8fe2f54851ab38a62c4fe12"
Janos Follath044a86b2015-10-25 10:58:03 +0100858
Darryl Green11999bb2018-03-13 15:22:58 +0000859Test mbedtls_mpi_add_mpi inplace #3
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100860mpi_add_mpi_inplace:"ffffffffffffffffffffffffffffffff":"01fffffffffffffffffffffffffffffffe"
Janos Follath6c922682015-10-30 17:43:11 +0100861
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200862Test mbedtls_mpi_add_int #1
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100863mpi_add_int:"10cc4ebcb68cbdaa438b80692d9e586b384ae3e1fa33f3db5962d394bec17fd92ad4189":9871232:"10cc4ebcb68cbdaa438b80692d9e586b384ae3e1fa33f3db5962d394bec17fd9343e109"
Paul Bakker367dae42009-06-28 21:50:27 +0000864
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200865Test mbedtls_mpi_add_int #2
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100866mpi_add_int:"10cc4ebcb68cbdaa438b80692d9e586b384ae3e1fa33f3db5962d394bec17fd92ad4189":-9871232:"10cc4ebcb68cbdaa438b80692d9e586b384ae3e1fa33f3db5962d394bec17fd9216a209"
Paul Bakker367dae42009-06-28 21:50:27 +0000867
Gilles Peskine36374882021-06-08 23:01:13 +0200868Test mbedtls_mpi_add_int: 0 (null) + 0
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100869mpi_add_int:"":0:"0"
Gilles Peskine36374882021-06-08 23:01:13 +0200870
871Test mbedtls_mpi_add_int: 0 (null) + 1
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100872mpi_add_int:"":1:"1"
Gilles Peskine36374882021-06-08 23:01:13 +0200873
Gilles Peskine43e89e12021-01-27 22:24:30 +0100874Base test mbedtls_mpi_sub_abs #1 (|B| > |A|)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100875mpi_sub_abs:"5":"7":"0":MBEDTLS_ERR_MPI_NEGATIVE_VALUE
Paul Bakker367dae42009-06-28 21:50:27 +0000876
Gilles Peskine43e89e12021-01-27 22:24:30 +0100877Base test mbedtls_mpi_sub_abs #2 (|B| > |A|)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100878mpi_sub_abs:"-5":"-7":"0":MBEDTLS_ERR_MPI_NEGATIVE_VALUE
Paul Bakker367dae42009-06-28 21:50:27 +0000879
Gilles Peskine43e89e12021-01-27 22:24:30 +0100880Base test mbedtls_mpi_sub_abs #3 (|B| > |A|)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100881mpi_sub_abs:"-5":"7":"0":MBEDTLS_ERR_MPI_NEGATIVE_VALUE
Paul Bakker367dae42009-06-28 21:50:27 +0000882
Gilles Peskine43e89e12021-01-27 22:24:30 +0100883Base test mbedtls_mpi_sub_abs #4 (|B| > |A|)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100884mpi_sub_abs:"5":"-7":"0":MBEDTLS_ERR_MPI_NEGATIVE_VALUE
Paul Bakker367dae42009-06-28 21:50:27 +0000885
Gilles Peskine43e89e12021-01-27 22:24:30 +0100886Base test mbedtls_mpi_sub_abs #1 (|B| >> |A| with more limbs)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100887mpi_sub_abs:"5":"123456789abcdef01":"0":MBEDTLS_ERR_MPI_NEGATIVE_VALUE
Gilles Peskine43e89e12021-01-27 22:24:30 +0100888
889Base test mbedtls_mpi_sub_abs #2 (|B| >> |A| with more limbs)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100890mpi_sub_abs:"-5":"-123456789abcdef01":"0":MBEDTLS_ERR_MPI_NEGATIVE_VALUE
Gilles Peskine43e89e12021-01-27 22:24:30 +0100891
892Base test mbedtls_mpi_sub_abs #3 (|B| >> |A| with more limbs)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100893mpi_sub_abs:"-5":"123456789abcdef01":"0":MBEDTLS_ERR_MPI_NEGATIVE_VALUE
Gilles Peskine43e89e12021-01-27 22:24:30 +0100894
895Base test mbedtls_mpi_sub_abs #4 (|B| >> |A| with more limbs)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100896mpi_sub_abs:"5":"-123456789abcdef01":"0":MBEDTLS_ERR_MPI_NEGATIVE_VALUE
Gilles Peskine43e89e12021-01-27 22:24:30 +0100897
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200898Base test mbedtls_mpi_sub_abs #1
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100899mpi_sub_abs:"7":"5":"2":0
Paul Bakker367dae42009-06-28 21:50:27 +0000900
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200901Base test mbedtls_mpi_sub_abs #2
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100902mpi_sub_abs:"-7":"-5":"2":0
Paul Bakker367dae42009-06-28 21:50:27 +0000903
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200904Base test mbedtls_mpi_sub_abs #3
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100905mpi_sub_abs:"-7":"5":"2":0
Paul Bakker367dae42009-06-28 21:50:27 +0000906
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200907Base test mbedtls_mpi_sub_abs #4
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100908mpi_sub_abs:"7":"-5":"2":0
Paul Bakker367dae42009-06-28 21:50:27 +0000909
Gilles Peskine36374882021-06-08 23:01:13 +0200910Test mbedtls_mpi_sub_abs: 0 (null) - 0 (null)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100911mpi_sub_abs:"":"":"":0
Gilles Peskine36374882021-06-08 23:01:13 +0200912
913Test mbedtls_mpi_sub_abs: 0 (null) - 0 (1 limb)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100914mpi_sub_abs:"":"00":"":0
Gilles Peskine36374882021-06-08 23:01:13 +0200915
916Test mbedtls_mpi_sub_abs: 0 (1 limb) - 0 (null)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100917mpi_sub_abs:"00":"":"":0
Gilles Peskine36374882021-06-08 23:01:13 +0200918
919Test mbedtls_mpi_sub_abs: 0 (1 limb) - 0 (1 limb)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100920mpi_sub_abs:"00":"00":"":0
Gilles Peskine36374882021-06-08 23:01:13 +0200921
922Test mbedtls_mpi_sub_abs: 1 - 0 (null)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100923mpi_sub_abs:"01":"":"01":0
Gilles Peskine36374882021-06-08 23:01:13 +0200924
925Test mbedtls_mpi_sub_abs: 0 (null) - 1
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100926mpi_sub_abs:"":"01":"":MBEDTLS_ERR_MPI_NEGATIVE_VALUE
Gilles Peskine36374882021-06-08 23:01:13 +0200927
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200928Test mbedtls_mpi_sub_abs #1
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100929mpi_sub_abs:"FFFFFFFFFF":"01":"FFFFFFFFFE":0
Paul Bakkerc847f072010-01-18 21:26:30 +0000930
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200931Test mbedtls_mpi_sub_abs #2
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100932mpi_sub_abs:"FFFFFFFFF0":"01":"FFFFFFFFEF":0
Paul Bakkerc847f072010-01-18 21:26:30 +0000933
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200934Test mbedtls_mpi_sub_abs #3
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100935mpi_sub_abs:"FF00000000":"0F00000000":"F000000000":0
Paul Bakkerc847f072010-01-18 21:26:30 +0000936
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200937Test mbedtls_mpi_sub_abs #4
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100938mpi_sub_abs:"FF00000000":"0F00000001":"EFFFFFFFFF":0
Paul Bakkerc847f072010-01-18 21:26:30 +0000939
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200940Base test mbedtls_mpi_sub_mpi #1 (Test with negative result)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100941mpi_sub_mpi:"5":"7":"-2"
Paul Bakker367dae42009-06-28 21:50:27 +0000942
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200943Base test mbedtls_mpi_sub_mpi #2 (Test with negative inputs)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100944mpi_sub_mpi:"-5":"-7":"2"
Paul Bakker367dae42009-06-28 21:50:27 +0000945
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200946Base test mbedtls_mpi_sub_mpi #3 (Test with negative base)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100947mpi_sub_mpi:"-5":"7":"-c"
Paul Bakker367dae42009-06-28 21:50:27 +0000948
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200949Base test mbedtls_mpi_sub_mpi #4 (Test with negative subtraction)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100950mpi_sub_mpi:"5":"-7":"c"
Paul Bakker367dae42009-06-28 21:50:27 +0000951
Gilles Peskine36374882021-06-08 23:01:13 +0200952Test mbedtls_mpi_sub_mpi: 0 (null) - 0 (null)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100953mpi_sub_mpi:"":"":"0"
Gilles Peskine36374882021-06-08 23:01:13 +0200954
955Test mbedtls_mpi_sub_mpi: 0 (null) - 0 (1 limb)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100956mpi_sub_mpi:"":"00":"0"
Gilles Peskine36374882021-06-08 23:01:13 +0200957
958Test mbedtls_mpi_sub_mpi: 0 (null) - 1
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100959mpi_sub_mpi:"":"1":"-1"
Gilles Peskine36374882021-06-08 23:01:13 +0200960
961Test mbedtls_mpi_sub_mpi: 0 (null) - -1
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100962mpi_sub_mpi:"":"-1":"1"
Gilles Peskine36374882021-06-08 23:01:13 +0200963
964Test mbedtls_mpi_sub_mpi: 0 (1 limb) - 0 (null)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100965mpi_sub_mpi:"00":"":"0"
Gilles Peskine36374882021-06-08 23:01:13 +0200966
967Test mbedtls_mpi_sub_mpi: 1 - 0 (null)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100968mpi_sub_mpi:"1":"":"1"
Gilles Peskine36374882021-06-08 23:01:13 +0200969
970Test mbedtls_mpi_sub_mpi: -1 - 0 (null)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100971mpi_sub_mpi:"-1":"":"-1"
Gilles Peskine36374882021-06-08 23:01:13 +0200972
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200973Test mbedtls_mpi_sub_mpi #1
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100974mpi_sub_mpi:"cb50e82a8583f44ee0025942e7362991b24e12663a0ddc234a57b0f7b4ff7b025bf5a6707dedc2898e70b739042c95a996283dffdf67558768784553c61e302e8812bc90f0bb0696870cfb910b560cefed8d99bbf7a00b31ccdbd56f3594e5a653cfd127d2167b13119e5c45c3f76b4e3d904a9bc0cbb43c33aa7f23b":"4df72d07b4b71c8dacb6cffa954f8d88254b6277099308baf003fab73227f34029643b5a263f66e0d3c3fa297ef71755efd53b8fb6cb812c6bbf7bcf179298bd9947c4c8b14324140a2c0f5fad7958a69050a987a6096e9f055fb38edf0c5889eca4a0cfa99b45fbdeee4c696b328ddceae4723945901ec025076b12b":"7d59bb22d0ccd7c1334b894851e69c098d02afef307ad3685a53b64082d787c232916b1657ae5ba8baacbd0f85357e53a6530270289bd45afcb8c984ae8b9770eecaf7c83f77e2827ce0ec315ddcb4495d3cf03451969c92c77c21e056888d1c672b3058287b351732b00fdc58c4dd7152abd8627b3b957c0ea314110"
Paul Bakker367dae42009-06-28 21:50:27 +0000975
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200976Test mbedtls_mpi_sub_mpi #2 (Test for negative result)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100977mpi_sub_mpi:"1f55332c3a48b910f9942f6c914e58bef37a47ee45cb164a5b6b8d1006bf59a059c21449939ebebfdf517d2e1dbac88010d7b1f141e997bd6801ddaec9d05910f4f2de2b2c4d714e2c14a72fc7f17aa428d59c531627f09":"941379d00fed1491dec0abfc13b52b9049625b3c42c3a972a2549e7a3e1b12c5a304b23e9ed6e251b8af28a4b3124900b23138bfafda925ab3410d57d6f8f0dd8c8c32eb0b4329fbf792e43f9593e766fa0c3c0be077b4e5162616a6428c51b":"-941379d00fed1491bf6b78cfd96c727f4fce2bcfb17550b3aeda568bf84ffc7b4799252e981788b15eed145b1f738a40d2dfbb91921fc9daa2695b66950f5920248a553c4172d0eb02a0061469467618cdf794dc18863a40ed507a532c64612"
Paul Bakker367dae42009-06-28 21:50:27 +0000978
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200979Test mbedtls_mpi_sub_int #1
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100980mpi_sub_int:"10cc4ebcb68cbdaa438b80692d9e586b384ae3e1fa33f3db5962d394bec17fd92ad4189":-9871232:"10cc4ebcb68cbdaa438b80692d9e586b384ae3e1fa33f3db5962d394bec17fd9343e109"
Paul Bakker367dae42009-06-28 21:50:27 +0000981
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200982Test mbedtls_mpi_sub_int #2
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100983mpi_sub_int:"10cc4ebcb68cbdaa438b80692d9e586b384ae3e1fa33f3db5962d394bec17fd92ad4189":9871232:"10cc4ebcb68cbdaa438b80692d9e586b384ae3e1fa33f3db5962d394bec17fd9216a209"
Paul Bakker367dae42009-06-28 21:50:27 +0000984
Gilles Peskine36374882021-06-08 23:01:13 +0200985Test mbedtls_mpi_sub_int: 0 (null) - 0
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100986mpi_sub_int:"":0:"0"
Gilles Peskine36374882021-06-08 23:01:13 +0200987
988Test mbedtls_mpi_sub_int: 0 (null) - 1
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100989mpi_sub_int:"":1:"-1"
Gilles Peskine36374882021-06-08 23:01:13 +0200990
991Test mbedtls_mpi_sub_int: 0 (null) - -1
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100992mpi_sub_int:"":-1:"1"
Gilles Peskine36374882021-06-08 23:01:13 +0200993
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200994Test mbedtls_mpi_shift_l #1
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100995mpi_shift_l:"40":1:"80"
Paul Bakker367dae42009-06-28 21:50:27 +0000996
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200997Test mbedtls_mpi_shift_l #2
Tom Cosgrove1b2947a2022-09-02 10:24:55 +0100998mpi_shift_l:"1946e2958a85d8863ae21f4904fcc49478412534ed53eaf321f63f2a2227a3c63acbf50b6305595f90cfa8327f6db80d986fe96080bcbb5df1bdbe9b74fb8dedf2bddb3f8215b54dffd66409323bcc473e45a8fe9d08e77a511698b5dad0416305db7fcf":37:"328dc52b150bb10c75c43e9209f98928f0824a69daa7d5e643ec7e54444f478c7597ea16c60ab2bf219f5064fedb701b30dfd2c1017976bbe37b7d36e9f71bdbe57bb67f042b6a9bffacc8126477988e7c8b51fd3a11cef4a22d316bb5a082c60bb6ff9e000000000"
Paul Bakker367dae42009-06-28 21:50:27 +0000999
Gilles Peskine36374882021-06-08 23:01:13 +02001000Test mbedtls_mpi_shift_l: 0 (null) <<= 0
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001001mpi_shift_l:"":0:"0"
Gilles Peskine36374882021-06-08 23:01:13 +02001002
1003Test mbedtls_mpi_shift_l: 0 (null) <<= 1
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001004mpi_shift_l:"":1:"0"
Gilles Peskine36374882021-06-08 23:01:13 +02001005
1006Test mbedtls_mpi_shift_l: 0 (null) <<= 64
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001007mpi_shift_l:"":64:"0"
Gilles Peskine36374882021-06-08 23:01:13 +02001008
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001009Test mbedtls_mpi_shift_r #1
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001010mpi_shift_r:"80":1:"40"
Paul Bakker367dae42009-06-28 21:50:27 +00001011
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001012Test mbedtls_mpi_shift_r #2
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001013mpi_shift_r:"4a36ce2a2eba161116629d6196efb17ee4f01ef753cd32b9e952d4d69e4b2401e85e0c3ba0ea761f44e312db10209fb6b38963c9c0302dc67b1b531c32301d8d341968c734387ef8bc2496051e0bb530975839852d8dd15684788f9dca62cb0c372ac51":45:"251b6715175d0b088b314eb0cb77d8bf72780f7ba9e6995cf4a96a6b4f259200f42f061dd0753b0fa271896d88104fdb59c4b1e4e01816e33d8da98e19180ec69a0cb4639a1c3f7c5e124b028f05da984bac1cc296c6e8ab423c47cee531"
Paul Bakker367dae42009-06-28 21:50:27 +00001014
Gilles Peskineefa2ac82019-09-19 21:20:26 +02001015Test mbedtls_mpi_shift_r #4 [#1]
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001016mpi_shift_r:"FFFFFFFFFFFFFFFF":63:"01"
Manuel Pégourié-Gonnarde44ec102012-11-17 12:42:51 +01001017
Gilles Peskineefa2ac82019-09-19 21:20:26 +02001018Test mbedtls_mpi_shift_r #4 [#2]
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001019mpi_shift_r:"FFFFFFFFFFFFFFFF":64:"00"
Manuel Pégourié-Gonnarde44ec102012-11-17 12:42:51 +01001020
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001021Test mbedtls_mpi_shift_r #6
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001022mpi_shift_r:"FFFFFFFFFFFFFFFF":65:"00"
Manuel Pégourié-Gonnarde44ec102012-11-17 12:42:51 +01001023
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001024Test mbedtls_mpi_shift_r #7
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001025mpi_shift_r:"FFFFFFFFFFFFFFFF":128:"00"
Manuel Pégourié-Gonnarde44ec102012-11-17 12:42:51 +01001026
Gilles Peskine36374882021-06-08 23:01:13 +02001027Test mbedtls_mpi_shift_r: 0 (null) >>= 0
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001028mpi_shift_r:"":0:"0"
Gilles Peskine36374882021-06-08 23:01:13 +02001029
1030Test mbedtls_mpi_shift_r: 0 (null) >>= 1
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001031mpi_shift_r:"":1:"0"
Gilles Peskine36374882021-06-08 23:01:13 +02001032
1033Test mbedtls_mpi_shift_r: 0 (null) >>= 64
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001034mpi_shift_r:"":64:"0"
Gilles Peskine36374882021-06-08 23:01:13 +02001035
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001036Base test mbedtls_mpi_mul_mpi #1
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001037mpi_mul_mpi:"5":"7":"23"
Paul Bakker367dae42009-06-28 21:50:27 +00001038
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001039Base test mbedtls_mpi_mul_mpi #2
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001040mpi_mul_mpi:"-5":"7":"-23"
Paul Bakker367dae42009-06-28 21:50:27 +00001041
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001042Base test mbedtls_mpi_mul_mpi #3
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001043mpi_mul_mpi:"5":"-7":"-23"
Paul Bakker367dae42009-06-28 21:50:27 +00001044
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001045Base test mbedtls_mpi_mul_mpi #4
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001046mpi_mul_mpi:"-5":"-7":"23"
Paul Bakker367dae42009-06-28 21:50:27 +00001047
Gilles Peskine36374882021-06-08 23:01:13 +02001048Test mbedtls_mpi_mul_mpi: 0 (null) * 0 (null)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001049mpi_mul_mpi:"":"":"0"
Gilles Peskine36374882021-06-08 23:01:13 +02001050
1051Test mbedtls_mpi_mul_mpi: 0 (null) * 0 (1 limb)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001052mpi_mul_mpi:"":"00":"0"
Gilles Peskine36374882021-06-08 23:01:13 +02001053
1054Test mbedtls_mpi_mul_mpi: 0 (null) * 1
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001055mpi_mul_mpi:"":"01":"0"
Gilles Peskine36374882021-06-08 23:01:13 +02001056
1057Test mbedtls_mpi_mul_mpi: 0 (null) * -1
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001058mpi_mul_mpi:"":"-01":"0"
Gilles Peskine36374882021-06-08 23:01:13 +02001059
Gilles Peskinef4998b02021-06-10 15:51:54 +02001060Test mbedtls_mpi_mul_mpi: 0 (1 limb) * -1
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001061mpi_mul_mpi:"00":"-01":"0"
Gilles Peskinef4998b02021-06-10 15:51:54 +02001062
Gilles Peskine36374882021-06-08 23:01:13 +02001063Test mbedtls_mpi_mul_mpi: 0 (1 limb) * 0 (null)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001064mpi_mul_mpi:"00":"":"0"
Gilles Peskine36374882021-06-08 23:01:13 +02001065
1066Test mbedtls_mpi_mul_mpi: 1 * 0 (null)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001067mpi_mul_mpi:"01":"":"0"
Gilles Peskine36374882021-06-08 23:01:13 +02001068
1069Test mbedtls_mpi_mul_mpi: -1 * 0 (null)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001070mpi_mul_mpi:"-01":"":"0"
Gilles Peskine36374882021-06-08 23:01:13 +02001071
Gilles Peskinef4998b02021-06-10 15:51:54 +02001072Test mbedtls_mpi_mul_mpi: -1 * 0 (1 limb)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001073mpi_mul_mpi:"-01":"00":"0"
Gilles Peskinef4998b02021-06-10 15:51:54 +02001074
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001075Test mbedtls_mpi_mul_mpi #1
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001076mpi_mul_mpi:"02f77b94b179d4a51360f04fa56e2c0784ce3b8a742280b016904896a5605fbe9e0f0683f82c439d979ab14e11b34e05ae96232b18fb2e0d1319f4942732d7eadf92ae90cb8c68ec8ece154d334f553564b6f6db185b33b8d3635598c3d128acde8bbb7b13697e48d1a542e5f9168d2d83a8dd05ae1eaf2451":"01b0b14c432710cde936e3fc100515e95dca61e10b8a68d9632bfa0546a9731a1ce6bebc6cb5fe6f5fd7e57b25f737f6a0ce5402e216b8b81c06f0c5ccce447d7f5631d14bff9dfa16f7cc72c56c84b636d00a5f35199d17ee9bf3f8746f44374ffd4ae22cf84089f04a9f7f356d6dc9f8cf8ef208a9b88c89":"0503ae899d35ae5b7706b067aed7cb2952da37a5d4ad58f05f69abe14e8aaae88eab2baed858177cb4595c0edc92e5ac13c2bba2bfa23276dd023e9e52f547d4c9edb138d86aad329d7afb01e15eab7281e181cb249fc91bf09d621d86561301edda156f80e3bbff853a312852fe9e3d0541cb86801390aff1dc3c05bcb592c266f625b70e419b4c7e7e85399bb06c0e50b099b4292f9eaff4d869681faa1f745b5fcb3349ed93c572739a31dcf76b43370cf9f86cc54e982dfac9467bde915c697e60554e0d698be6bb2dd1f8bc64659f6baee7641b51f4b5ed7010c04600fcd382db84a93fe3d4d86e86a459c6cebb59"
Gilles Peskine997be0a2021-06-15 21:44:32 +02001077
1078Test mbedtls_mpi_mul_mpi #1, leading 0 limb in B
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001079mpi_mul_mpi:"02f77b94b179d4a51360f04fa56e2c0784ce3b8a742280b016904896a5605fbe9e0f0683f82c439d979ab14e11b34e05ae96232b18fb2e0d1319f4942732d7eadf92ae90cb8c68ec8ece154d334f553564b6f6db185b33b8d3635598c3d128acde8bbb7b13697e48d1a542e5f9168d2d83a8dd05ae1eaf2451":"000000000000000001b0b14c432710cde936e3fc100515e95dca61e10b8a68d9632bfa0546a9731a1ce6bebc6cb5fe6f5fd7e57b25f737f6a0ce5402e216b8b81c06f0c5ccce447d7f5631d14bff9dfa16f7cc72c56c84b636d00a5f35199d17ee9bf3f8746f44374ffd4ae22cf84089f04a9f7f356d6dc9f8cf8ef208a9b88c89":"0503ae899d35ae5b7706b067aed7cb2952da37a5d4ad58f05f69abe14e8aaae88eab2baed858177cb4595c0edc92e5ac13c2bba2bfa23276dd023e9e52f547d4c9edb138d86aad329d7afb01e15eab7281e181cb249fc91bf09d621d86561301edda156f80e3bbff853a312852fe9e3d0541cb86801390aff1dc3c05bcb592c266f625b70e419b4c7e7e85399bb06c0e50b099b4292f9eaff4d869681faa1f745b5fcb3349ed93c572739a31dcf76b43370cf9f86cc54e982dfac9467bde915c697e60554e0d698be6bb2dd1f8bc64659f6baee7641b51f4b5ed7010c04600fcd382db84a93fe3d4d86e86a459c6cebb59"
Gilles Peskine997be0a2021-06-15 21:44:32 +02001080
1081Test mbedtls_mpi_mul_mpi #1, leading 0 limb in B, A < 0
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001082mpi_mul_mpi:"-02f77b94b179d4a51360f04fa56e2c0784ce3b8a742280b016904896a5605fbe9e0f0683f82c439d979ab14e11b34e05ae96232b18fb2e0d1319f4942732d7eadf92ae90cb8c68ec8ece154d334f553564b6f6db185b33b8d3635598c3d128acde8bbb7b13697e48d1a542e5f9168d2d83a8dd05ae1eaf2451":"000000000000000001b0b14c432710cde936e3fc100515e95dca61e10b8a68d9632bfa0546a9731a1ce6bebc6cb5fe6f5fd7e57b25f737f6a0ce5402e216b8b81c06f0c5ccce447d7f5631d14bff9dfa16f7cc72c56c84b636d00a5f35199d17ee9bf3f8746f44374ffd4ae22cf84089f04a9f7f356d6dc9f8cf8ef208a9b88c89":"-0503ae899d35ae5b7706b067aed7cb2952da37a5d4ad58f05f69abe14e8aaae88eab2baed858177cb4595c0edc92e5ac13c2bba2bfa23276dd023e9e52f547d4c9edb138d86aad329d7afb01e15eab7281e181cb249fc91bf09d621d86561301edda156f80e3bbff853a312852fe9e3d0541cb86801390aff1dc3c05bcb592c266f625b70e419b4c7e7e85399bb06c0e50b099b4292f9eaff4d869681faa1f745b5fcb3349ed93c572739a31dcf76b43370cf9f86cc54e982dfac9467bde915c697e60554e0d698be6bb2dd1f8bc64659f6baee7641b51f4b5ed7010c04600fcd382db84a93fe3d4d86e86a459c6cebb59"
Gilles Peskine997be0a2021-06-15 21:44:32 +02001083
1084Test mbedtls_mpi_mul_mpi #1, leading 0 limb in B, B < 0
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001085mpi_mul_mpi:"02f77b94b179d4a51360f04fa56e2c0784ce3b8a742280b016904896a5605fbe9e0f0683f82c439d979ab14e11b34e05ae96232b18fb2e0d1319f4942732d7eadf92ae90cb8c68ec8ece154d334f553564b6f6db185b33b8d3635598c3d128acde8bbb7b13697e48d1a542e5f9168d2d83a8dd05ae1eaf2451":"-000000000000000001b0b14c432710cde936e3fc100515e95dca61e10b8a68d9632bfa0546a9731a1ce6bebc6cb5fe6f5fd7e57b25f737f6a0ce5402e216b8b81c06f0c5ccce447d7f5631d14bff9dfa16f7cc72c56c84b636d00a5f35199d17ee9bf3f8746f44374ffd4ae22cf84089f04a9f7f356d6dc9f8cf8ef208a9b88c89":"-0503ae899d35ae5b7706b067aed7cb2952da37a5d4ad58f05f69abe14e8aaae88eab2baed858177cb4595c0edc92e5ac13c2bba2bfa23276dd023e9e52f547d4c9edb138d86aad329d7afb01e15eab7281e181cb249fc91bf09d621d86561301edda156f80e3bbff853a312852fe9e3d0541cb86801390aff1dc3c05bcb592c266f625b70e419b4c7e7e85399bb06c0e50b099b4292f9eaff4d869681faa1f745b5fcb3349ed93c572739a31dcf76b43370cf9f86cc54e982dfac9467bde915c697e60554e0d698be6bb2dd1f8bc64659f6baee7641b51f4b5ed7010c04600fcd382db84a93fe3d4d86e86a459c6cebb59"
Gilles Peskine997be0a2021-06-15 21:44:32 +02001086
1087Test mbedtls_mpi_mul_mpi #1, leading 0 limb in B, A < 0, B < 0
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001088mpi_mul_mpi:"-02f77b94b179d4a51360f04fa56e2c0784ce3b8a742280b016904896a5605fbe9e0f0683f82c439d979ab14e11b34e05ae96232b18fb2e0d1319f4942732d7eadf92ae90cb8c68ec8ece154d334f553564b6f6db185b33b8d3635598c3d128acde8bbb7b13697e48d1a542e5f9168d2d83a8dd05ae1eaf2451":"-000000000000000001b0b14c432710cde936e3fc100515e95dca61e10b8a68d9632bfa0546a9731a1ce6bebc6cb5fe6f5fd7e57b25f737f6a0ce5402e216b8b81c06f0c5ccce447d7f5631d14bff9dfa16f7cc72c56c84b636d00a5f35199d17ee9bf3f8746f44374ffd4ae22cf84089f04a9f7f356d6dc9f8cf8ef208a9b88c89":"0503ae899d35ae5b7706b067aed7cb2952da37a5d4ad58f05f69abe14e8aaae88eab2baed858177cb4595c0edc92e5ac13c2bba2bfa23276dd023e9e52f547d4c9edb138d86aad329d7afb01e15eab7281e181cb249fc91bf09d621d86561301edda156f80e3bbff853a312852fe9e3d0541cb86801390aff1dc3c05bcb592c266f625b70e419b4c7e7e85399bb06c0e50b099b4292f9eaff4d869681faa1f745b5fcb3349ed93c572739a31dcf76b43370cf9f86cc54e982dfac9467bde915c697e60554e0d698be6bb2dd1f8bc64659f6baee7641b51f4b5ed7010c04600fcd382db84a93fe3d4d86e86a459c6cebb59"
Gilles Peskine997be0a2021-06-15 21:44:32 +02001089
1090Test mbedtls_mpi_mul_mpi #1, leading 0 limb in A
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001091mpi_mul_mpi:"000000000000000002f77b94b179d4a51360f04fa56e2c0784ce3b8a742280b016904896a5605fbe9e0f0683f82c439d979ab14e11b34e05ae96232b18fb2e0d1319f4942732d7eadf92ae90cb8c68ec8ece154d334f553564b6f6db185b33b8d3635598c3d128acde8bbb7b13697e48d1a542e5f9168d2d83a8dd05ae1eaf2451":"01b0b14c432710cde936e3fc100515e95dca61e10b8a68d9632bfa0546a9731a1ce6bebc6cb5fe6f5fd7e57b25f737f6a0ce5402e216b8b81c06f0c5ccce447d7f5631d14bff9dfa16f7cc72c56c84b636d00a5f35199d17ee9bf3f8746f44374ffd4ae22cf84089f04a9f7f356d6dc9f8cf8ef208a9b88c89":"0503ae899d35ae5b7706b067aed7cb2952da37a5d4ad58f05f69abe14e8aaae88eab2baed858177cb4595c0edc92e5ac13c2bba2bfa23276dd023e9e52f547d4c9edb138d86aad329d7afb01e15eab7281e181cb249fc91bf09d621d86561301edda156f80e3bbff853a312852fe9e3d0541cb86801390aff1dc3c05bcb592c266f625b70e419b4c7e7e85399bb06c0e50b099b4292f9eaff4d869681faa1f745b5fcb3349ed93c572739a31dcf76b43370cf9f86cc54e982dfac9467bde915c697e60554e0d698be6bb2dd1f8bc64659f6baee7641b51f4b5ed7010c04600fcd382db84a93fe3d4d86e86a459c6cebb59"
Gilles Peskine997be0a2021-06-15 21:44:32 +02001092
1093Test mbedtls_mpi_mul_mpi #1, leading 0 limb in A, A < 0
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001094mpi_mul_mpi:"-000000000000000002f77b94b179d4a51360f04fa56e2c0784ce3b8a742280b016904896a5605fbe9e0f0683f82c439d979ab14e11b34e05ae96232b18fb2e0d1319f4942732d7eadf92ae90cb8c68ec8ece154d334f553564b6f6db185b33b8d3635598c3d128acde8bbb7b13697e48d1a542e5f9168d2d83a8dd05ae1eaf2451":"01b0b14c432710cde936e3fc100515e95dca61e10b8a68d9632bfa0546a9731a1ce6bebc6cb5fe6f5fd7e57b25f737f6a0ce5402e216b8b81c06f0c5ccce447d7f5631d14bff9dfa16f7cc72c56c84b636d00a5f35199d17ee9bf3f8746f44374ffd4ae22cf84089f04a9f7f356d6dc9f8cf8ef208a9b88c89":"-0503ae899d35ae5b7706b067aed7cb2952da37a5d4ad58f05f69abe14e8aaae88eab2baed858177cb4595c0edc92e5ac13c2bba2bfa23276dd023e9e52f547d4c9edb138d86aad329d7afb01e15eab7281e181cb249fc91bf09d621d86561301edda156f80e3bbff853a312852fe9e3d0541cb86801390aff1dc3c05bcb592c266f625b70e419b4c7e7e85399bb06c0e50b099b4292f9eaff4d869681faa1f745b5fcb3349ed93c572739a31dcf76b43370cf9f86cc54e982dfac9467bde915c697e60554e0d698be6bb2dd1f8bc64659f6baee7641b51f4b5ed7010c04600fcd382db84a93fe3d4d86e86a459c6cebb59"
Gilles Peskine997be0a2021-06-15 21:44:32 +02001095
1096Test mbedtls_mpi_mul_mpi #1, leading 0 limb in A, B < 0
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001097mpi_mul_mpi:"000000000000000002f77b94b179d4a51360f04fa56e2c0784ce3b8a742280b016904896a5605fbe9e0f0683f82c439d979ab14e11b34e05ae96232b18fb2e0d1319f4942732d7eadf92ae90cb8c68ec8ece154d334f553564b6f6db185b33b8d3635598c3d128acde8bbb7b13697e48d1a542e5f9168d2d83a8dd05ae1eaf2451":"-01b0b14c432710cde936e3fc100515e95dca61e10b8a68d9632bfa0546a9731a1ce6bebc6cb5fe6f5fd7e57b25f737f6a0ce5402e216b8b81c06f0c5ccce447d7f5631d14bff9dfa16f7cc72c56c84b636d00a5f35199d17ee9bf3f8746f44374ffd4ae22cf84089f04a9f7f356d6dc9f8cf8ef208a9b88c89":"-0503ae899d35ae5b7706b067aed7cb2952da37a5d4ad58f05f69abe14e8aaae88eab2baed858177cb4595c0edc92e5ac13c2bba2bfa23276dd023e9e52f547d4c9edb138d86aad329d7afb01e15eab7281e181cb249fc91bf09d621d86561301edda156f80e3bbff853a312852fe9e3d0541cb86801390aff1dc3c05bcb592c266f625b70e419b4c7e7e85399bb06c0e50b099b4292f9eaff4d869681faa1f745b5fcb3349ed93c572739a31dcf76b43370cf9f86cc54e982dfac9467bde915c697e60554e0d698be6bb2dd1f8bc64659f6baee7641b51f4b5ed7010c04600fcd382db84a93fe3d4d86e86a459c6cebb59"
Gilles Peskine997be0a2021-06-15 21:44:32 +02001098
1099Test mbedtls_mpi_mul_mpi #1, leading 0 limb in A, A < 0, B < 0
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001100mpi_mul_mpi:"-000000000000000002f77b94b179d4a51360f04fa56e2c0784ce3b8a742280b016904896a5605fbe9e0f0683f82c439d979ab14e11b34e05ae96232b18fb2e0d1319f4942732d7eadf92ae90cb8c68ec8ece154d334f553564b6f6db185b33b8d3635598c3d128acde8bbb7b13697e48d1a542e5f9168d2d83a8dd05ae1eaf2451":"-01b0b14c432710cde936e3fc100515e95dca61e10b8a68d9632bfa0546a9731a1ce6bebc6cb5fe6f5fd7e57b25f737f6a0ce5402e216b8b81c06f0c5ccce447d7f5631d14bff9dfa16f7cc72c56c84b636d00a5f35199d17ee9bf3f8746f44374ffd4ae22cf84089f04a9f7f356d6dc9f8cf8ef208a9b88c89":"0503ae899d35ae5b7706b067aed7cb2952da37a5d4ad58f05f69abe14e8aaae88eab2baed858177cb4595c0edc92e5ac13c2bba2bfa23276dd023e9e52f547d4c9edb138d86aad329d7afb01e15eab7281e181cb249fc91bf09d621d86561301edda156f80e3bbff853a312852fe9e3d0541cb86801390aff1dc3c05bcb592c266f625b70e419b4c7e7e85399bb06c0e50b099b4292f9eaff4d869681faa1f745b5fcb3349ed93c572739a31dcf76b43370cf9f86cc54e982dfac9467bde915c697e60554e0d698be6bb2dd1f8bc64659f6baee7641b51f4b5ed7010c04600fcd382db84a93fe3d4d86e86a459c6cebb59"
Gilles Peskine997be0a2021-06-15 21:44:32 +02001101
1102Test mbedtls_mpi_mul_mpi #1, leading 0 limb in A and B
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001103mpi_mul_mpi:"000000000000000002f77b94b179d4a51360f04fa56e2c0784ce3b8a742280b016904896a5605fbe9e0f0683f82c439d979ab14e11b34e05ae96232b18fb2e0d1319f4942732d7eadf92ae90cb8c68ec8ece154d334f553564b6f6db185b33b8d3635598c3d128acde8bbb7b13697e48d1a542e5f9168d2d83a8dd05ae1eaf2451":"000000000000000001b0b14c432710cde936e3fc100515e95dca61e10b8a68d9632bfa0546a9731a1ce6bebc6cb5fe6f5fd7e57b25f737f6a0ce5402e216b8b81c06f0c5ccce447d7f5631d14bff9dfa16f7cc72c56c84b636d00a5f35199d17ee9bf3f8746f44374ffd4ae22cf84089f04a9f7f356d6dc9f8cf8ef208a9b88c89":"0503ae899d35ae5b7706b067aed7cb2952da37a5d4ad58f05f69abe14e8aaae88eab2baed858177cb4595c0edc92e5ac13c2bba2bfa23276dd023e9e52f547d4c9edb138d86aad329d7afb01e15eab7281e181cb249fc91bf09d621d86561301edda156f80e3bbff853a312852fe9e3d0541cb86801390aff1dc3c05bcb592c266f625b70e419b4c7e7e85399bb06c0e50b099b4292f9eaff4d869681faa1f745b5fcb3349ed93c572739a31dcf76b43370cf9f86cc54e982dfac9467bde915c697e60554e0d698be6bb2dd1f8bc64659f6baee7641b51f4b5ed7010c04600fcd382db84a93fe3d4d86e86a459c6cebb59"
Gilles Peskine997be0a2021-06-15 21:44:32 +02001104
1105Test mbedtls_mpi_mul_mpi #1, leading 0 limb in A and B, A < 0
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001106mpi_mul_mpi:"-000000000000000002f77b94b179d4a51360f04fa56e2c0784ce3b8a742280b016904896a5605fbe9e0f0683f82c439d979ab14e11b34e05ae96232b18fb2e0d1319f4942732d7eadf92ae90cb8c68ec8ece154d334f553564b6f6db185b33b8d3635598c3d128acde8bbb7b13697e48d1a542e5f9168d2d83a8dd05ae1eaf2451":"000000000000000001b0b14c432710cde936e3fc100515e95dca61e10b8a68d9632bfa0546a9731a1ce6bebc6cb5fe6f5fd7e57b25f737f6a0ce5402e216b8b81c06f0c5ccce447d7f5631d14bff9dfa16f7cc72c56c84b636d00a5f35199d17ee9bf3f8746f44374ffd4ae22cf84089f04a9f7f356d6dc9f8cf8ef208a9b88c89":"-0503ae899d35ae5b7706b067aed7cb2952da37a5d4ad58f05f69abe14e8aaae88eab2baed858177cb4595c0edc92e5ac13c2bba2bfa23276dd023e9e52f547d4c9edb138d86aad329d7afb01e15eab7281e181cb249fc91bf09d621d86561301edda156f80e3bbff853a312852fe9e3d0541cb86801390aff1dc3c05bcb592c266f625b70e419b4c7e7e85399bb06c0e50b099b4292f9eaff4d869681faa1f745b5fcb3349ed93c572739a31dcf76b43370cf9f86cc54e982dfac9467bde915c697e60554e0d698be6bb2dd1f8bc64659f6baee7641b51f4b5ed7010c04600fcd382db84a93fe3d4d86e86a459c6cebb59"
Gilles Peskine997be0a2021-06-15 21:44:32 +02001107
1108Test mbedtls_mpi_mul_mpi #1, leading 0 limb in A and B, B < 0
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001109mpi_mul_mpi:"000000000000000002f77b94b179d4a51360f04fa56e2c0784ce3b8a742280b016904896a5605fbe9e0f0683f82c439d979ab14e11b34e05ae96232b18fb2e0d1319f4942732d7eadf92ae90cb8c68ec8ece154d334f553564b6f6db185b33b8d3635598c3d128acde8bbb7b13697e48d1a542e5f9168d2d83a8dd05ae1eaf2451":"-000000000000000001b0b14c432710cde936e3fc100515e95dca61e10b8a68d9632bfa0546a9731a1ce6bebc6cb5fe6f5fd7e57b25f737f6a0ce5402e216b8b81c06f0c5ccce447d7f5631d14bff9dfa16f7cc72c56c84b636d00a5f35199d17ee9bf3f8746f44374ffd4ae22cf84089f04a9f7f356d6dc9f8cf8ef208a9b88c89":"-0503ae899d35ae5b7706b067aed7cb2952da37a5d4ad58f05f69abe14e8aaae88eab2baed858177cb4595c0edc92e5ac13c2bba2bfa23276dd023e9e52f547d4c9edb138d86aad329d7afb01e15eab7281e181cb249fc91bf09d621d86561301edda156f80e3bbff853a312852fe9e3d0541cb86801390aff1dc3c05bcb592c266f625b70e419b4c7e7e85399bb06c0e50b099b4292f9eaff4d869681faa1f745b5fcb3349ed93c572739a31dcf76b43370cf9f86cc54e982dfac9467bde915c697e60554e0d698be6bb2dd1f8bc64659f6baee7641b51f4b5ed7010c04600fcd382db84a93fe3d4d86e86a459c6cebb59"
Gilles Peskine997be0a2021-06-15 21:44:32 +02001110
1111Test mbedtls_mpi_mul_mpi #1, leading 0 limb in A and B, A < 0, B < 0
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001112mpi_mul_mpi:"-000000000000000002f77b94b179d4a51360f04fa56e2c0784ce3b8a742280b016904896a5605fbe9e0f0683f82c439d979ab14e11b34e05ae96232b18fb2e0d1319f4942732d7eadf92ae90cb8c68ec8ece154d334f553564b6f6db185b33b8d3635598c3d128acde8bbb7b13697e48d1a542e5f9168d2d83a8dd05ae1eaf2451":"-000000000000000001b0b14c432710cde936e3fc100515e95dca61e10b8a68d9632bfa0546a9731a1ce6bebc6cb5fe6f5fd7e57b25f737f6a0ce5402e216b8b81c06f0c5ccce447d7f5631d14bff9dfa16f7cc72c56c84b636d00a5f35199d17ee9bf3f8746f44374ffd4ae22cf84089f04a9f7f356d6dc9f8cf8ef208a9b88c89":"0503ae899d35ae5b7706b067aed7cb2952da37a5d4ad58f05f69abe14e8aaae88eab2baed858177cb4595c0edc92e5ac13c2bba2bfa23276dd023e9e52f547d4c9edb138d86aad329d7afb01e15eab7281e181cb249fc91bf09d621d86561301edda156f80e3bbff853a312852fe9e3d0541cb86801390aff1dc3c05bcb592c266f625b70e419b4c7e7e85399bb06c0e50b099b4292f9eaff4d869681faa1f745b5fcb3349ed93c572739a31dcf76b43370cf9f86cc54e982dfac9467bde915c697e60554e0d698be6bb2dd1f8bc64659f6baee7641b51f4b5ed7010c04600fcd382db84a93fe3d4d86e86a459c6cebb59"
Gilles Peskine997be0a2021-06-15 21:44:32 +02001113
1114Test mbedtls_mpi_mul_mpi #2, trailing 0 limb in A
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001115mpi_mul_mpi:"02f77b94b179d4a51360f04fa56e2c0784ce3b8a742280b016904896a5605fbe9e0f0683f82c439d979ab14e11b34e05ae96232b18fb2e0d1319f4942732d7eadf92ae90cb8c68ec8ece154d334f553564b6f6db185b33b8d3635598c3d128acde8bbb7b13697e48d1a542e5f9168d2d83a8dd05ae1eaf24510000000000000000":"01b0b14c432710cde936e3fc100515e95dca61e10b8a68d9632bfa0546a9731a1ce6bebc6cb5fe6f5fd7e57b25f737f6a0ce5402e216b8b81c06f0c5ccce447d7f5631d14bff9dfa16f7cc72c56c84b636d00a5f35199d17ee9bf3f8746f44374ffd4ae22cf84089f04a9f7f356d6dc9f8cf8ef208a9b88c89":"0503ae899d35ae5b7706b067aed7cb2952da37a5d4ad58f05f69abe14e8aaae88eab2baed858177cb4595c0edc92e5ac13c2bba2bfa23276dd023e9e52f547d4c9edb138d86aad329d7afb01e15eab7281e181cb249fc91bf09d621d86561301edda156f80e3bbff853a312852fe9e3d0541cb86801390aff1dc3c05bcb592c266f625b70e419b4c7e7e85399bb06c0e50b099b4292f9eaff4d869681faa1f745b5fcb3349ed93c572739a31dcf76b43370cf9f86cc54e982dfac9467bde915c697e60554e0d698be6bb2dd1f8bc64659f6baee7641b51f4b5ed7010c04600fcd382db84a93fe3d4d86e86a459c6cebb590000000000000000"
Gilles Peskine997be0a2021-06-15 21:44:32 +02001116
1117Test mbedtls_mpi_mul_mpi #2, trailing 0 limb in A, A < 0
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001118mpi_mul_mpi:"-02f77b94b179d4a51360f04fa56e2c0784ce3b8a742280b016904896a5605fbe9e0f0683f82c439d979ab14e11b34e05ae96232b18fb2e0d1319f4942732d7eadf92ae90cb8c68ec8ece154d334f553564b6f6db185b33b8d3635598c3d128acde8bbb7b13697e48d1a542e5f9168d2d83a8dd05ae1eaf24510000000000000000":"01b0b14c432710cde936e3fc100515e95dca61e10b8a68d9632bfa0546a9731a1ce6bebc6cb5fe6f5fd7e57b25f737f6a0ce5402e216b8b81c06f0c5ccce447d7f5631d14bff9dfa16f7cc72c56c84b636d00a5f35199d17ee9bf3f8746f44374ffd4ae22cf84089f04a9f7f356d6dc9f8cf8ef208a9b88c89":"-0503ae899d35ae5b7706b067aed7cb2952da37a5d4ad58f05f69abe14e8aaae88eab2baed858177cb4595c0edc92e5ac13c2bba2bfa23276dd023e9e52f547d4c9edb138d86aad329d7afb01e15eab7281e181cb249fc91bf09d621d86561301edda156f80e3bbff853a312852fe9e3d0541cb86801390aff1dc3c05bcb592c266f625b70e419b4c7e7e85399bb06c0e50b099b4292f9eaff4d869681faa1f745b5fcb3349ed93c572739a31dcf76b43370cf9f86cc54e982dfac9467bde915c697e60554e0d698be6bb2dd1f8bc64659f6baee7641b51f4b5ed7010c04600fcd382db84a93fe3d4d86e86a459c6cebb590000000000000000"
Gilles Peskine997be0a2021-06-15 21:44:32 +02001119
1120Test mbedtls_mpi_mul_mpi #2, trailing 0 limb in A, B < 0
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001121mpi_mul_mpi:"02f77b94b179d4a51360f04fa56e2c0784ce3b8a742280b016904896a5605fbe9e0f0683f82c439d979ab14e11b34e05ae96232b18fb2e0d1319f4942732d7eadf92ae90cb8c68ec8ece154d334f553564b6f6db185b33b8d3635598c3d128acde8bbb7b13697e48d1a542e5f9168d2d83a8dd05ae1eaf24510000000000000000":"-01b0b14c432710cde936e3fc100515e95dca61e10b8a68d9632bfa0546a9731a1ce6bebc6cb5fe6f5fd7e57b25f737f6a0ce5402e216b8b81c06f0c5ccce447d7f5631d14bff9dfa16f7cc72c56c84b636d00a5f35199d17ee9bf3f8746f44374ffd4ae22cf84089f04a9f7f356d6dc9f8cf8ef208a9b88c89":"-0503ae899d35ae5b7706b067aed7cb2952da37a5d4ad58f05f69abe14e8aaae88eab2baed858177cb4595c0edc92e5ac13c2bba2bfa23276dd023e9e52f547d4c9edb138d86aad329d7afb01e15eab7281e181cb249fc91bf09d621d86561301edda156f80e3bbff853a312852fe9e3d0541cb86801390aff1dc3c05bcb592c266f625b70e419b4c7e7e85399bb06c0e50b099b4292f9eaff4d869681faa1f745b5fcb3349ed93c572739a31dcf76b43370cf9f86cc54e982dfac9467bde915c697e60554e0d698be6bb2dd1f8bc64659f6baee7641b51f4b5ed7010c04600fcd382db84a93fe3d4d86e86a459c6cebb590000000000000000"
Gilles Peskine997be0a2021-06-15 21:44:32 +02001122
1123Test mbedtls_mpi_mul_mpi #2, trailing 0 limb in A, A < 0, B < 0
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001124mpi_mul_mpi:"-02f77b94b179d4a51360f04fa56e2c0784ce3b8a742280b016904896a5605fbe9e0f0683f82c439d979ab14e11b34e05ae96232b18fb2e0d1319f4942732d7eadf92ae90cb8c68ec8ece154d334f553564b6f6db185b33b8d3635598c3d128acde8bbb7b13697e48d1a542e5f9168d2d83a8dd05ae1eaf24510000000000000000":"-01b0b14c432710cde936e3fc100515e95dca61e10b8a68d9632bfa0546a9731a1ce6bebc6cb5fe6f5fd7e57b25f737f6a0ce5402e216b8b81c06f0c5ccce447d7f5631d14bff9dfa16f7cc72c56c84b636d00a5f35199d17ee9bf3f8746f44374ffd4ae22cf84089f04a9f7f356d6dc9f8cf8ef208a9b88c89":"0503ae899d35ae5b7706b067aed7cb2952da37a5d4ad58f05f69abe14e8aaae88eab2baed858177cb4595c0edc92e5ac13c2bba2bfa23276dd023e9e52f547d4c9edb138d86aad329d7afb01e15eab7281e181cb249fc91bf09d621d86561301edda156f80e3bbff853a312852fe9e3d0541cb86801390aff1dc3c05bcb592c266f625b70e419b4c7e7e85399bb06c0e50b099b4292f9eaff4d869681faa1f745b5fcb3349ed93c572739a31dcf76b43370cf9f86cc54e982dfac9467bde915c697e60554e0d698be6bb2dd1f8bc64659f6baee7641b51f4b5ed7010c04600fcd382db84a93fe3d4d86e86a459c6cebb590000000000000000"
Gilles Peskine997be0a2021-06-15 21:44:32 +02001125
1126Test mbedtls_mpi_mul_mpi #2, trailing 0 limb in B
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001127mpi_mul_mpi:"02f77b94b179d4a51360f04fa56e2c0784ce3b8a742280b016904896a5605fbe9e0f0683f82c439d979ab14e11b34e05ae96232b18fb2e0d1319f4942732d7eadf92ae90cb8c68ec8ece154d334f553564b6f6db185b33b8d3635598c3d128acde8bbb7b13697e48d1a542e5f9168d2d83a8dd05ae1eaf2451":"01b0b14c432710cde936e3fc100515e95dca61e10b8a68d9632bfa0546a9731a1ce6bebc6cb5fe6f5fd7e57b25f737f6a0ce5402e216b8b81c06f0c5ccce447d7f5631d14bff9dfa16f7cc72c56c84b636d00a5f35199d17ee9bf3f8746f44374ffd4ae22cf84089f04a9f7f356d6dc9f8cf8ef208a9b88c890000000000000000":"0503ae899d35ae5b7706b067aed7cb2952da37a5d4ad58f05f69abe14e8aaae88eab2baed858177cb4595c0edc92e5ac13c2bba2bfa23276dd023e9e52f547d4c9edb138d86aad329d7afb01e15eab7281e181cb249fc91bf09d621d86561301edda156f80e3bbff853a312852fe9e3d0541cb86801390aff1dc3c05bcb592c266f625b70e419b4c7e7e85399bb06c0e50b099b4292f9eaff4d869681faa1f745b5fcb3349ed93c572739a31dcf76b43370cf9f86cc54e982dfac9467bde915c697e60554e0d698be6bb2dd1f8bc64659f6baee7641b51f4b5ed7010c04600fcd382db84a93fe3d4d86e86a459c6cebb590000000000000000"
Gilles Peskine997be0a2021-06-15 21:44:32 +02001128
1129Test mbedtls_mpi_mul_mpi #2, trailing 0 limb in B, A < 0
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001130mpi_mul_mpi:"-02f77b94b179d4a51360f04fa56e2c0784ce3b8a742280b016904896a5605fbe9e0f0683f82c439d979ab14e11b34e05ae96232b18fb2e0d1319f4942732d7eadf92ae90cb8c68ec8ece154d334f553564b6f6db185b33b8d3635598c3d128acde8bbb7b13697e48d1a542e5f9168d2d83a8dd05ae1eaf2451":"01b0b14c432710cde936e3fc100515e95dca61e10b8a68d9632bfa0546a9731a1ce6bebc6cb5fe6f5fd7e57b25f737f6a0ce5402e216b8b81c06f0c5ccce447d7f5631d14bff9dfa16f7cc72c56c84b636d00a5f35199d17ee9bf3f8746f44374ffd4ae22cf84089f04a9f7f356d6dc9f8cf8ef208a9b88c890000000000000000":"-0503ae899d35ae5b7706b067aed7cb2952da37a5d4ad58f05f69abe14e8aaae88eab2baed858177cb4595c0edc92e5ac13c2bba2bfa23276dd023e9e52f547d4c9edb138d86aad329d7afb01e15eab7281e181cb249fc91bf09d621d86561301edda156f80e3bbff853a312852fe9e3d0541cb86801390aff1dc3c05bcb592c266f625b70e419b4c7e7e85399bb06c0e50b099b4292f9eaff4d869681faa1f745b5fcb3349ed93c572739a31dcf76b43370cf9f86cc54e982dfac9467bde915c697e60554e0d698be6bb2dd1f8bc64659f6baee7641b51f4b5ed7010c04600fcd382db84a93fe3d4d86e86a459c6cebb590000000000000000"
Gilles Peskine997be0a2021-06-15 21:44:32 +02001131
1132Test mbedtls_mpi_mul_mpi #2, trailing 0 limb in B, B < 0
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001133mpi_mul_mpi:"02f77b94b179d4a51360f04fa56e2c0784ce3b8a742280b016904896a5605fbe9e0f0683f82c439d979ab14e11b34e05ae96232b18fb2e0d1319f4942732d7eadf92ae90cb8c68ec8ece154d334f553564b6f6db185b33b8d3635598c3d128acde8bbb7b13697e48d1a542e5f9168d2d83a8dd05ae1eaf2451":"-01b0b14c432710cde936e3fc100515e95dca61e10b8a68d9632bfa0546a9731a1ce6bebc6cb5fe6f5fd7e57b25f737f6a0ce5402e216b8b81c06f0c5ccce447d7f5631d14bff9dfa16f7cc72c56c84b636d00a5f35199d17ee9bf3f8746f44374ffd4ae22cf84089f04a9f7f356d6dc9f8cf8ef208a9b88c890000000000000000":"-0503ae899d35ae5b7706b067aed7cb2952da37a5d4ad58f05f69abe14e8aaae88eab2baed858177cb4595c0edc92e5ac13c2bba2bfa23276dd023e9e52f547d4c9edb138d86aad329d7afb01e15eab7281e181cb249fc91bf09d621d86561301edda156f80e3bbff853a312852fe9e3d0541cb86801390aff1dc3c05bcb592c266f625b70e419b4c7e7e85399bb06c0e50b099b4292f9eaff4d869681faa1f745b5fcb3349ed93c572739a31dcf76b43370cf9f86cc54e982dfac9467bde915c697e60554e0d698be6bb2dd1f8bc64659f6baee7641b51f4b5ed7010c04600fcd382db84a93fe3d4d86e86a459c6cebb590000000000000000"
Gilles Peskine997be0a2021-06-15 21:44:32 +02001134
1135Test mbedtls_mpi_mul_mpi #2, trailing 0 limb in B, A < 0, B < 0
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001136mpi_mul_mpi:"-02f77b94b179d4a51360f04fa56e2c0784ce3b8a742280b016904896a5605fbe9e0f0683f82c439d979ab14e11b34e05ae96232b18fb2e0d1319f4942732d7eadf92ae90cb8c68ec8ece154d334f553564b6f6db185b33b8d3635598c3d128acde8bbb7b13697e48d1a542e5f9168d2d83a8dd05ae1eaf2451":"-01b0b14c432710cde936e3fc100515e95dca61e10b8a68d9632bfa0546a9731a1ce6bebc6cb5fe6f5fd7e57b25f737f6a0ce5402e216b8b81c06f0c5ccce447d7f5631d14bff9dfa16f7cc72c56c84b636d00a5f35199d17ee9bf3f8746f44374ffd4ae22cf84089f04a9f7f356d6dc9f8cf8ef208a9b88c890000000000000000":"0503ae899d35ae5b7706b067aed7cb2952da37a5d4ad58f05f69abe14e8aaae88eab2baed858177cb4595c0edc92e5ac13c2bba2bfa23276dd023e9e52f547d4c9edb138d86aad329d7afb01e15eab7281e181cb249fc91bf09d621d86561301edda156f80e3bbff853a312852fe9e3d0541cb86801390aff1dc3c05bcb592c266f625b70e419b4c7e7e85399bb06c0e50b099b4292f9eaff4d869681faa1f745b5fcb3349ed93c572739a31dcf76b43370cf9f86cc54e982dfac9467bde915c697e60554e0d698be6bb2dd1f8bc64659f6baee7641b51f4b5ed7010c04600fcd382db84a93fe3d4d86e86a459c6cebb590000000000000000"
Gilles Peskine997be0a2021-06-15 21:44:32 +02001137
1138Test mbedtls_mpi_mul_mpi #2, trailing 0 limb in A and B
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001139mpi_mul_mpi:"02f77b94b179d4a51360f04fa56e2c0784ce3b8a742280b016904896a5605fbe9e0f0683f82c439d979ab14e11b34e05ae96232b18fb2e0d1319f4942732d7eadf92ae90cb8c68ec8ece154d334f553564b6f6db185b33b8d3635598c3d128acde8bbb7b13697e48d1a542e5f9168d2d83a8dd05ae1eaf24510000000000000000":"01b0b14c432710cde936e3fc100515e95dca61e10b8a68d9632bfa0546a9731a1ce6bebc6cb5fe6f5fd7e57b25f737f6a0ce5402e216b8b81c06f0c5ccce447d7f5631d14bff9dfa16f7cc72c56c84b636d00a5f35199d17ee9bf3f8746f44374ffd4ae22cf84089f04a9f7f356d6dc9f8cf8ef208a9b88c890000000000000000":"0503ae899d35ae5b7706b067aed7cb2952da37a5d4ad58f05f69abe14e8aaae88eab2baed858177cb4595c0edc92e5ac13c2bba2bfa23276dd023e9e52f547d4c9edb138d86aad329d7afb01e15eab7281e181cb249fc91bf09d621d86561301edda156f80e3bbff853a312852fe9e3d0541cb86801390aff1dc3c05bcb592c266f625b70e419b4c7e7e85399bb06c0e50b099b4292f9eaff4d869681faa1f745b5fcb3349ed93c572739a31dcf76b43370cf9f86cc54e982dfac9467bde915c697e60554e0d698be6bb2dd1f8bc64659f6baee7641b51f4b5ed7010c04600fcd382db84a93fe3d4d86e86a459c6cebb5900000000000000000000000000000000"
Gilles Peskine997be0a2021-06-15 21:44:32 +02001140
1141Test mbedtls_mpi_mul_mpi #2, trailing 0 limb in A and B, A < 0
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001142mpi_mul_mpi:"-02f77b94b179d4a51360f04fa56e2c0784ce3b8a742280b016904896a5605fbe9e0f0683f82c439d979ab14e11b34e05ae96232b18fb2e0d1319f4942732d7eadf92ae90cb8c68ec8ece154d334f553564b6f6db185b33b8d3635598c3d128acde8bbb7b13697e48d1a542e5f9168d2d83a8dd05ae1eaf24510000000000000000":"01b0b14c432710cde936e3fc100515e95dca61e10b8a68d9632bfa0546a9731a1ce6bebc6cb5fe6f5fd7e57b25f737f6a0ce5402e216b8b81c06f0c5ccce447d7f5631d14bff9dfa16f7cc72c56c84b636d00a5f35199d17ee9bf3f8746f44374ffd4ae22cf84089f04a9f7f356d6dc9f8cf8ef208a9b88c890000000000000000":"-0503ae899d35ae5b7706b067aed7cb2952da37a5d4ad58f05f69abe14e8aaae88eab2baed858177cb4595c0edc92e5ac13c2bba2bfa23276dd023e9e52f547d4c9edb138d86aad329d7afb01e15eab7281e181cb249fc91bf09d621d86561301edda156f80e3bbff853a312852fe9e3d0541cb86801390aff1dc3c05bcb592c266f625b70e419b4c7e7e85399bb06c0e50b099b4292f9eaff4d869681faa1f745b5fcb3349ed93c572739a31dcf76b43370cf9f86cc54e982dfac9467bde915c697e60554e0d698be6bb2dd1f8bc64659f6baee7641b51f4b5ed7010c04600fcd382db84a93fe3d4d86e86a459c6cebb5900000000000000000000000000000000"
Gilles Peskine997be0a2021-06-15 21:44:32 +02001143
1144Test mbedtls_mpi_mul_mpi #2, trailing 0 limb in A and B, B < 0
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001145mpi_mul_mpi:"02f77b94b179d4a51360f04fa56e2c0784ce3b8a742280b016904896a5605fbe9e0f0683f82c439d979ab14e11b34e05ae96232b18fb2e0d1319f4942732d7eadf92ae90cb8c68ec8ece154d334f553564b6f6db185b33b8d3635598c3d128acde8bbb7b13697e48d1a542e5f9168d2d83a8dd05ae1eaf24510000000000000000":"-01b0b14c432710cde936e3fc100515e95dca61e10b8a68d9632bfa0546a9731a1ce6bebc6cb5fe6f5fd7e57b25f737f6a0ce5402e216b8b81c06f0c5ccce447d7f5631d14bff9dfa16f7cc72c56c84b636d00a5f35199d17ee9bf3f8746f44374ffd4ae22cf84089f04a9f7f356d6dc9f8cf8ef208a9b88c890000000000000000":"-0503ae899d35ae5b7706b067aed7cb2952da37a5d4ad58f05f69abe14e8aaae88eab2baed858177cb4595c0edc92e5ac13c2bba2bfa23276dd023e9e52f547d4c9edb138d86aad329d7afb01e15eab7281e181cb249fc91bf09d621d86561301edda156f80e3bbff853a312852fe9e3d0541cb86801390aff1dc3c05bcb592c266f625b70e419b4c7e7e85399bb06c0e50b099b4292f9eaff4d869681faa1f745b5fcb3349ed93c572739a31dcf76b43370cf9f86cc54e982dfac9467bde915c697e60554e0d698be6bb2dd1f8bc64659f6baee7641b51f4b5ed7010c04600fcd382db84a93fe3d4d86e86a459c6cebb5900000000000000000000000000000000"
Gilles Peskine997be0a2021-06-15 21:44:32 +02001146
1147Test mbedtls_mpi_mul_mpi #2, trailing 0 limb in A and B, A < 0, B < 0
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001148mpi_mul_mpi:"-02f77b94b179d4a51360f04fa56e2c0784ce3b8a742280b016904896a5605fbe9e0f0683f82c439d979ab14e11b34e05ae96232b18fb2e0d1319f4942732d7eadf92ae90cb8c68ec8ece154d334f553564b6f6db185b33b8d3635598c3d128acde8bbb7b13697e48d1a542e5f9168d2d83a8dd05ae1eaf24510000000000000000":"-01b0b14c432710cde936e3fc100515e95dca61e10b8a68d9632bfa0546a9731a1ce6bebc6cb5fe6f5fd7e57b25f737f6a0ce5402e216b8b81c06f0c5ccce447d7f5631d14bff9dfa16f7cc72c56c84b636d00a5f35199d17ee9bf3f8746f44374ffd4ae22cf84089f04a9f7f356d6dc9f8cf8ef208a9b88c890000000000000000":"0503ae899d35ae5b7706b067aed7cb2952da37a5d4ad58f05f69abe14e8aaae88eab2baed858177cb4595c0edc92e5ac13c2bba2bfa23276dd023e9e52f547d4c9edb138d86aad329d7afb01e15eab7281e181cb249fc91bf09d621d86561301edda156f80e3bbff853a312852fe9e3d0541cb86801390aff1dc3c05bcb592c266f625b70e419b4c7e7e85399bb06c0e50b099b4292f9eaff4d869681faa1f745b5fcb3349ed93c572739a31dcf76b43370cf9f86cc54e982dfac9467bde915c697e60554e0d698be6bb2dd1f8bc64659f6baee7641b51f4b5ed7010c04600fcd382db84a93fe3d4d86e86a459c6cebb5900000000000000000000000000000000"
Gilles Peskine997be0a2021-06-15 21:44:32 +02001149
1150Test mbedtls_mpi_mul_mpi #3, trailing 0 limbs in A
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001151mpi_mul_mpi:"02f77b94b179d4a51360f04fa56e2c0784ce3b8a742280b016904896a5605fbe9e0f0683f82c439d979ab14e11b34e05ae96232b18fb2e0d1319f4942732d7eadf92ae90cb8c68ec8ece154d334f553564b6f6db185b33b8d3635598c3d128acde8bbb7b13697e48d1a542e5f9168d2d83a8dd05ae1eaf245100000000000000000000000000000000":"01b0b14c432710cde936e3fc100515e95dca61e10b8a68d9632bfa0546a9731a1ce6bebc6cb5fe6f5fd7e57b25f737f6a0ce5402e216b8b81c06f0c5ccce447d7f5631d14bff9dfa16f7cc72c56c84b636d00a5f35199d17ee9bf3f8746f44374ffd4ae22cf84089f04a9f7f356d6dc9f8cf8ef208a9b88c89":"0503ae899d35ae5b7706b067aed7cb2952da37a5d4ad58f05f69abe14e8aaae88eab2baed858177cb4595c0edc92e5ac13c2bba2bfa23276dd023e9e52f547d4c9edb138d86aad329d7afb01e15eab7281e181cb249fc91bf09d621d86561301edda156f80e3bbff853a312852fe9e3d0541cb86801390aff1dc3c05bcb592c266f625b70e419b4c7e7e85399bb06c0e50b099b4292f9eaff4d869681faa1f745b5fcb3349ed93c572739a31dcf76b43370cf9f86cc54e982dfac9467bde915c697e60554e0d698be6bb2dd1f8bc64659f6baee7641b51f4b5ed7010c04600fcd382db84a93fe3d4d86e86a459c6cebb5900000000000000000000000000000000"
Gilles Peskine997be0a2021-06-15 21:44:32 +02001152
1153Test mbedtls_mpi_mul_mpi #3, trailing 0 limbs in A, A < 0
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001154mpi_mul_mpi:"-02f77b94b179d4a51360f04fa56e2c0784ce3b8a742280b016904896a5605fbe9e0f0683f82c439d979ab14e11b34e05ae96232b18fb2e0d1319f4942732d7eadf92ae90cb8c68ec8ece154d334f553564b6f6db185b33b8d3635598c3d128acde8bbb7b13697e48d1a542e5f9168d2d83a8dd05ae1eaf245100000000000000000000000000000000":"01b0b14c432710cde936e3fc100515e95dca61e10b8a68d9632bfa0546a9731a1ce6bebc6cb5fe6f5fd7e57b25f737f6a0ce5402e216b8b81c06f0c5ccce447d7f5631d14bff9dfa16f7cc72c56c84b636d00a5f35199d17ee9bf3f8746f44374ffd4ae22cf84089f04a9f7f356d6dc9f8cf8ef208a9b88c89":"-0503ae899d35ae5b7706b067aed7cb2952da37a5d4ad58f05f69abe14e8aaae88eab2baed858177cb4595c0edc92e5ac13c2bba2bfa23276dd023e9e52f547d4c9edb138d86aad329d7afb01e15eab7281e181cb249fc91bf09d621d86561301edda156f80e3bbff853a312852fe9e3d0541cb86801390aff1dc3c05bcb592c266f625b70e419b4c7e7e85399bb06c0e50b099b4292f9eaff4d869681faa1f745b5fcb3349ed93c572739a31dcf76b43370cf9f86cc54e982dfac9467bde915c697e60554e0d698be6bb2dd1f8bc64659f6baee7641b51f4b5ed7010c04600fcd382db84a93fe3d4d86e86a459c6cebb5900000000000000000000000000000000"
Gilles Peskine997be0a2021-06-15 21:44:32 +02001155
1156Test mbedtls_mpi_mul_mpi #3, trailing 0 limbs in A, B < 0
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001157mpi_mul_mpi:"02f77b94b179d4a51360f04fa56e2c0784ce3b8a742280b016904896a5605fbe9e0f0683f82c439d979ab14e11b34e05ae96232b18fb2e0d1319f4942732d7eadf92ae90cb8c68ec8ece154d334f553564b6f6db185b33b8d3635598c3d128acde8bbb7b13697e48d1a542e5f9168d2d83a8dd05ae1eaf245100000000000000000000000000000000":"-01b0b14c432710cde936e3fc100515e95dca61e10b8a68d9632bfa0546a9731a1ce6bebc6cb5fe6f5fd7e57b25f737f6a0ce5402e216b8b81c06f0c5ccce447d7f5631d14bff9dfa16f7cc72c56c84b636d00a5f35199d17ee9bf3f8746f44374ffd4ae22cf84089f04a9f7f356d6dc9f8cf8ef208a9b88c89":"-0503ae899d35ae5b7706b067aed7cb2952da37a5d4ad58f05f69abe14e8aaae88eab2baed858177cb4595c0edc92e5ac13c2bba2bfa23276dd023e9e52f547d4c9edb138d86aad329d7afb01e15eab7281e181cb249fc91bf09d621d86561301edda156f80e3bbff853a312852fe9e3d0541cb86801390aff1dc3c05bcb592c266f625b70e419b4c7e7e85399bb06c0e50b099b4292f9eaff4d869681faa1f745b5fcb3349ed93c572739a31dcf76b43370cf9f86cc54e982dfac9467bde915c697e60554e0d698be6bb2dd1f8bc64659f6baee7641b51f4b5ed7010c04600fcd382db84a93fe3d4d86e86a459c6cebb5900000000000000000000000000000000"
Gilles Peskine997be0a2021-06-15 21:44:32 +02001158
1159Test mbedtls_mpi_mul_mpi #3, trailing 0 limbs in A, A < 0, B < 0
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001160mpi_mul_mpi:"-02f77b94b179d4a51360f04fa56e2c0784ce3b8a742280b016904896a5605fbe9e0f0683f82c439d979ab14e11b34e05ae96232b18fb2e0d1319f4942732d7eadf92ae90cb8c68ec8ece154d334f553564b6f6db185b33b8d3635598c3d128acde8bbb7b13697e48d1a542e5f9168d2d83a8dd05ae1eaf245100000000000000000000000000000000":"-01b0b14c432710cde936e3fc100515e95dca61e10b8a68d9632bfa0546a9731a1ce6bebc6cb5fe6f5fd7e57b25f737f6a0ce5402e216b8b81c06f0c5ccce447d7f5631d14bff9dfa16f7cc72c56c84b636d00a5f35199d17ee9bf3f8746f44374ffd4ae22cf84089f04a9f7f356d6dc9f8cf8ef208a9b88c89":"0503ae899d35ae5b7706b067aed7cb2952da37a5d4ad58f05f69abe14e8aaae88eab2baed858177cb4595c0edc92e5ac13c2bba2bfa23276dd023e9e52f547d4c9edb138d86aad329d7afb01e15eab7281e181cb249fc91bf09d621d86561301edda156f80e3bbff853a312852fe9e3d0541cb86801390aff1dc3c05bcb592c266f625b70e419b4c7e7e85399bb06c0e50b099b4292f9eaff4d869681faa1f745b5fcb3349ed93c572739a31dcf76b43370cf9f86cc54e982dfac9467bde915c697e60554e0d698be6bb2dd1f8bc64659f6baee7641b51f4b5ed7010c04600fcd382db84a93fe3d4d86e86a459c6cebb5900000000000000000000000000000000"
Gilles Peskine997be0a2021-06-15 21:44:32 +02001161
1162Test mbedtls_mpi_mul_mpi #3, trailing 0 limbs in B
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001163mpi_mul_mpi:"02f77b94b179d4a51360f04fa56e2c0784ce3b8a742280b016904896a5605fbe9e0f0683f82c439d979ab14e11b34e05ae96232b18fb2e0d1319f4942732d7eadf92ae90cb8c68ec8ece154d334f553564b6f6db185b33b8d3635598c3d128acde8bbb7b13697e48d1a542e5f9168d2d83a8dd05ae1eaf2451":"01b0b14c432710cde936e3fc100515e95dca61e10b8a68d9632bfa0546a9731a1ce6bebc6cb5fe6f5fd7e57b25f737f6a0ce5402e216b8b81c06f0c5ccce447d7f5631d14bff9dfa16f7cc72c56c84b636d00a5f35199d17ee9bf3f8746f44374ffd4ae22cf84089f04a9f7f356d6dc9f8cf8ef208a9b88c8900000000000000000000000000000000":"0503ae899d35ae5b7706b067aed7cb2952da37a5d4ad58f05f69abe14e8aaae88eab2baed858177cb4595c0edc92e5ac13c2bba2bfa23276dd023e9e52f547d4c9edb138d86aad329d7afb01e15eab7281e181cb249fc91bf09d621d86561301edda156f80e3bbff853a312852fe9e3d0541cb86801390aff1dc3c05bcb592c266f625b70e419b4c7e7e85399bb06c0e50b099b4292f9eaff4d869681faa1f745b5fcb3349ed93c572739a31dcf76b43370cf9f86cc54e982dfac9467bde915c697e60554e0d698be6bb2dd1f8bc64659f6baee7641b51f4b5ed7010c04600fcd382db84a93fe3d4d86e86a459c6cebb5900000000000000000000000000000000"
Gilles Peskine997be0a2021-06-15 21:44:32 +02001164
1165Test mbedtls_mpi_mul_mpi #3, trailing 0 limbs in B, A < 0
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001166mpi_mul_mpi:"-02f77b94b179d4a51360f04fa56e2c0784ce3b8a742280b016904896a5605fbe9e0f0683f82c439d979ab14e11b34e05ae96232b18fb2e0d1319f4942732d7eadf92ae90cb8c68ec8ece154d334f553564b6f6db185b33b8d3635598c3d128acde8bbb7b13697e48d1a542e5f9168d2d83a8dd05ae1eaf2451":"01b0b14c432710cde936e3fc100515e95dca61e10b8a68d9632bfa0546a9731a1ce6bebc6cb5fe6f5fd7e57b25f737f6a0ce5402e216b8b81c06f0c5ccce447d7f5631d14bff9dfa16f7cc72c56c84b636d00a5f35199d17ee9bf3f8746f44374ffd4ae22cf84089f04a9f7f356d6dc9f8cf8ef208a9b88c8900000000000000000000000000000000":"-0503ae899d35ae5b7706b067aed7cb2952da37a5d4ad58f05f69abe14e8aaae88eab2baed858177cb4595c0edc92e5ac13c2bba2bfa23276dd023e9e52f547d4c9edb138d86aad329d7afb01e15eab7281e181cb249fc91bf09d621d86561301edda156f80e3bbff853a312852fe9e3d0541cb86801390aff1dc3c05bcb592c266f625b70e419b4c7e7e85399bb06c0e50b099b4292f9eaff4d869681faa1f745b5fcb3349ed93c572739a31dcf76b43370cf9f86cc54e982dfac9467bde915c697e60554e0d698be6bb2dd1f8bc64659f6baee7641b51f4b5ed7010c04600fcd382db84a93fe3d4d86e86a459c6cebb5900000000000000000000000000000000"
Gilles Peskine997be0a2021-06-15 21:44:32 +02001167
1168Test mbedtls_mpi_mul_mpi #3, trailing 0 limbs in B, B < 0
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001169mpi_mul_mpi:"02f77b94b179d4a51360f04fa56e2c0784ce3b8a742280b016904896a5605fbe9e0f0683f82c439d979ab14e11b34e05ae96232b18fb2e0d1319f4942732d7eadf92ae90cb8c68ec8ece154d334f553564b6f6db185b33b8d3635598c3d128acde8bbb7b13697e48d1a542e5f9168d2d83a8dd05ae1eaf2451":"-01b0b14c432710cde936e3fc100515e95dca61e10b8a68d9632bfa0546a9731a1ce6bebc6cb5fe6f5fd7e57b25f737f6a0ce5402e216b8b81c06f0c5ccce447d7f5631d14bff9dfa16f7cc72c56c84b636d00a5f35199d17ee9bf3f8746f44374ffd4ae22cf84089f04a9f7f356d6dc9f8cf8ef208a9b88c8900000000000000000000000000000000":"-0503ae899d35ae5b7706b067aed7cb2952da37a5d4ad58f05f69abe14e8aaae88eab2baed858177cb4595c0edc92e5ac13c2bba2bfa23276dd023e9e52f547d4c9edb138d86aad329d7afb01e15eab7281e181cb249fc91bf09d621d86561301edda156f80e3bbff853a312852fe9e3d0541cb86801390aff1dc3c05bcb592c266f625b70e419b4c7e7e85399bb06c0e50b099b4292f9eaff4d869681faa1f745b5fcb3349ed93c572739a31dcf76b43370cf9f86cc54e982dfac9467bde915c697e60554e0d698be6bb2dd1f8bc64659f6baee7641b51f4b5ed7010c04600fcd382db84a93fe3d4d86e86a459c6cebb5900000000000000000000000000000000"
Gilles Peskine997be0a2021-06-15 21:44:32 +02001170
1171Test mbedtls_mpi_mul_mpi #3, trailing 0 limbs in B, A < 0, B < 0
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001172mpi_mul_mpi:"-02f77b94b179d4a51360f04fa56e2c0784ce3b8a742280b016904896a5605fbe9e0f0683f82c439d979ab14e11b34e05ae96232b18fb2e0d1319f4942732d7eadf92ae90cb8c68ec8ece154d334f553564b6f6db185b33b8d3635598c3d128acde8bbb7b13697e48d1a542e5f9168d2d83a8dd05ae1eaf2451":"-01b0b14c432710cde936e3fc100515e95dca61e10b8a68d9632bfa0546a9731a1ce6bebc6cb5fe6f5fd7e57b25f737f6a0ce5402e216b8b81c06f0c5ccce447d7f5631d14bff9dfa16f7cc72c56c84b636d00a5f35199d17ee9bf3f8746f44374ffd4ae22cf84089f04a9f7f356d6dc9f8cf8ef208a9b88c8900000000000000000000000000000000":"0503ae899d35ae5b7706b067aed7cb2952da37a5d4ad58f05f69abe14e8aaae88eab2baed858177cb4595c0edc92e5ac13c2bba2bfa23276dd023e9e52f547d4c9edb138d86aad329d7afb01e15eab7281e181cb249fc91bf09d621d86561301edda156f80e3bbff853a312852fe9e3d0541cb86801390aff1dc3c05bcb592c266f625b70e419b4c7e7e85399bb06c0e50b099b4292f9eaff4d869681faa1f745b5fcb3349ed93c572739a31dcf76b43370cf9f86cc54e982dfac9467bde915c697e60554e0d698be6bb2dd1f8bc64659f6baee7641b51f4b5ed7010c04600fcd382db84a93fe3d4d86e86a459c6cebb5900000000000000000000000000000000"
Paul Bakker367dae42009-06-28 21:50:27 +00001173
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001174Test mbedtls_mpi_mul_int #1
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001175mpi_mul_int:"10cc4ebcb68cbdaa438b80692d9e586b384ae3e1fa33f3db5962d394bec17fd92ad4189":9871232:"9e22d6da18a33d1ef28d2a82242b3f6e9c9742f63e5d440f58a190bfaf23a7866e67589adb80":"=="
Paul Bakker367dae42009-06-28 21:50:27 +00001176
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001177Test mbedtls_mpi_mul_int #2 (Unsigned, thus failure)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001178mpi_mul_int:"10cc4ebcb68cbdaa438b80692d9e586b384ae3e1fa33f3db5962d394bec17fd92ad4189":-9871232:"-9e22d6da18a33d1ef28d2a82242b3f6e9c9742f63e5d440f58a190bfaf23a7866e67589adb80":"!="
Paul Bakker367dae42009-06-28 21:50:27 +00001179
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001180Test mbedtls_mpi_mul_int #3
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001181mpi_mul_int:"-10cc4ebcb68cbdaa438b80692d9e586b384ae3e1fa33f3db5962d394bec17fd92ad4189":9871232:"-9e22d6da18a33d1ef28d2a82242b3f6e9c9742f63e5d440f58a190bfaf23a7866e67589adb80":"=="
Paul Bakker367dae42009-06-28 21:50:27 +00001182
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001183Test mbedtls_mpi_mul_int #4 (Unsigned, thus failure)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001184mpi_mul_int:"-10cc4ebcb68cbdaa438b80692d9e586b384ae3e1fa33f3db5962d394bec17fd92ad4189":-9871232:"9e22d6da18a33d1ef28d2a82242b3f6e9c9742f63e5d440f58a190bfaf23a7866e67589adb80":"!="
Paul Bakker367dae42009-06-28 21:50:27 +00001185
Gilles Peskine36374882021-06-08 23:01:13 +02001186Test mbedtls_mpi_mul_int: 0 (null) * 0
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001187mpi_mul_int:"":0:"":"=="
Gilles Peskine36374882021-06-08 23:01:13 +02001188
1189Test mbedtls_mpi_mul_int: 0 (null) * 1
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001190mpi_mul_int:"":1:"":"=="
Gilles Peskine36374882021-06-08 23:01:13 +02001191
1192Test mbedtls_mpi_mul_int: 0 (null) * 0x1234
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001193mpi_mul_int:"":0x1234:"":"=="
Gilles Peskine36374882021-06-08 23:01:13 +02001194
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001195Base test mbedtls_mpi_div_mpi #1
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001196mpi_div_mpi:"3e8":"d":"4c":"c":0
Paul Bakker367dae42009-06-28 21:50:27 +00001197
Gilles Peskine5fb6f702021-06-08 23:00:17 +02001198Base test mbedtls_mpi_div_mpi #2 (Divide by zero (1 limb))
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001199mpi_div_mpi:"3e8":"0":"1":"1":MBEDTLS_ERR_MPI_DIVISION_BY_ZERO
Paul Bakker367dae42009-06-28 21:50:27 +00001200
Gilles Peskine36374882021-06-08 23:01:13 +02001201Base test mbedtls_mpi_div_mpi #2 (Divide by zero (null))
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001202mpi_div_mpi:"3e8":"":"1":"1":MBEDTLS_ERR_MPI_DIVISION_BY_ZERO
Gilles Peskine36374882021-06-08 23:01:13 +02001203
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001204Base test mbedtls_mpi_div_mpi #3
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001205mpi_div_mpi:"3e8":"-d":"-4c":"c":0
Paul Bakker367dae42009-06-28 21:50:27 +00001206
Gilles Peskine36374882021-06-08 23:01:13 +02001207Test mbedtls_mpi_div_mpi: 0 (null) / 0 (null)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001208mpi_div_mpi:"":"":"":"":MBEDTLS_ERR_MPI_DIVISION_BY_ZERO
Gilles Peskine36374882021-06-08 23:01:13 +02001209
1210Test mbedtls_mpi_div_mpi: 0 (null) / 0 (1 limb)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001211mpi_div_mpi:"":"0":"":"":MBEDTLS_ERR_MPI_DIVISION_BY_ZERO
Gilles Peskine36374882021-06-08 23:01:13 +02001212
1213Test mbedtls_mpi_div_mpi: 0 (1 limb) / 0 (null)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001214mpi_div_mpi:"0":"":"":"":MBEDTLS_ERR_MPI_DIVISION_BY_ZERO
Gilles Peskine36374882021-06-08 23:01:13 +02001215
1216Test mbedtls_mpi_div_mpi: 0 (1 limb) / 0 (1 limb)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001217mpi_div_mpi:"0":"0":"":"":MBEDTLS_ERR_MPI_DIVISION_BY_ZERO
Gilles Peskine36374882021-06-08 23:01:13 +02001218
1219Test mbedtls_mpi_div_mpi: 0 (null) / 1
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001220mpi_div_mpi:"":"1":"":"":0
Gilles Peskine36374882021-06-08 23:01:13 +02001221
1222Test mbedtls_mpi_div_mpi: 0 (null) / -1
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001223mpi_div_mpi:"":"-1":"":"":0
Gilles Peskine36374882021-06-08 23:01:13 +02001224
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001225Test mbedtls_mpi_div_mpi #1
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001226mpi_div_mpi:"9e22d6da18a33d1ef28d2a82242b3f6e9c9742f63e5d440f58a190bfaf23a7866e67589adb80":"22":"4a6abf75b13dc268ea9cc8b5b6aaf0ac85ecd437a4e0987fb13cf8d2acc57c0306c738c1583":"1a":0
Paul Bakker367dae42009-06-28 21:50:27 +00001227
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001228Test mbedtls_mpi_div_mpi #2
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001229mpi_div_mpi:"503ae899d35ae5b7706b067aed7cb2952da37a5d4ad58f05f69abe14e8aaae88eab2baed858177cb4595c0edc92e5ac13c2bba2bfa23276dd023e9e52f547d4c9edb138d86aad329d7afb01e15eab7281e181cb249fc91bf09d621d86561301edda156f80e3bbff853a312852fe9e3d0541cb86801390aff1dc3c05bcb592c266f625b70e419b4c7e7e85399bb06c0e50b099b4292f9eaff4d869681faa1f745b5fcb3349ed93c572739a31dcf76b43370cf9f86cc54e982dfac9467bde915c697e60554e0d698be6bb2dd1f8bc64659f6baee7641b51f4b5ed7010c04600fcd382db84a93fe3d4d86e86a459c6cebb5a":"2f77b94b179d4a51360f04fa56e2c0784ce3b8a742280b016904896a5605fbe9e0f0683f82c439d979ab14e11b34e05ae96232b18fb2e0d1319f4942732d7eadf92ae90cb8c68ec8ece154d334f553564b6f6db185b33b8d3635598c3d128acde8bbb7b13697e48d1a542e5f9168d2d83a8dd05ae1eaf2451":"1b0b14c432710cde936e3fc100515e95dca61e10b8a68d9632bfa0546a9731a1ce6bebc6cb5fe6f5fd7e57b25f737f6a0ce5402e216b8b81c06f0c5ccce447d7f5631d14bff9dfa16f7cc72c56c84b636d00a5f35199d17ee9bf3f8746f44374ffd4ae22cf84089f04a9f7f356d6dc9f8cf8ef208a9b88c89":"1":0
Paul Bakker367dae42009-06-28 21:50:27 +00001230
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001231Test mbedtls_mpi_div_mpi #3
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001232mpi_div_mpi:"3e8":"7":"8e":"6":0
Paul Bakkerba48cb22009-07-12 11:01:32 +00001233
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001234Test mbedtls_mpi_div_mpi #4
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001235mpi_div_mpi:"309":"7":"6f":"0":0
Paul Bakkerba48cb22009-07-12 11:01:32 +00001236
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001237Base test mbedtls_mpi_div_int #1
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001238mpi_div_int:"3e8":13:"4c":"c":0
Paul Bakker367dae42009-06-28 21:50:27 +00001239
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001240Base test mbedtls_mpi_div_int #2 (Divide by zero)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001241mpi_div_int:"3e8":0:"1":"1":MBEDTLS_ERR_MPI_DIVISION_BY_ZERO
Paul Bakker367dae42009-06-28 21:50:27 +00001242
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001243Base test mbedtls_mpi_div_int #3
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001244mpi_div_int:"3e8":-13:"-4c":"c":0
Paul Bakker367dae42009-06-28 21:50:27 +00001245
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001246Test mbedtls_mpi_div_int #1
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001247mpi_div_int:"9e22d6da18a33d1ef28d2a82242b3f6e9c9742f63e5d440f58a190bfaf23a7866e67589adb80":34:"4a6abf75b13dc268ea9cc8b5b6aaf0ac85ecd437a4e0987fb13cf8d2acc57c0306c738c1583":"1a":0
Paul Bakker367dae42009-06-28 21:50:27 +00001248
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001249Test mbedtls_mpi_div_int #2
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001250mpi_div_int:"9e22d6da18a33d1ef28d2a82242b3f6e9c9742f63e5d440f58a190bfaf23a7866e67589adb80":-34:"-4a6abf75b13dc268ea9cc8b5b6aaf0ac85ecd437a4e0987fb13cf8d2acc57c0306c738c1583":"1a":0
Paul Bakker367dae42009-06-28 21:50:27 +00001251
Gilles Peskine36374882021-06-08 23:01:13 +02001252Test mbedtls_mpi_div_int: 0 (null) / 0
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001253mpi_div_int:"":0:"":"":MBEDTLS_ERR_MPI_DIVISION_BY_ZERO
Gilles Peskine36374882021-06-08 23:01:13 +02001254
1255Test mbedtls_mpi_div_int: 0 (1 limb) / 0
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001256mpi_div_int:"00":0:"":"":MBEDTLS_ERR_MPI_DIVISION_BY_ZERO
Gilles Peskine36374882021-06-08 23:01:13 +02001257
1258Test mbedtls_mpi_div_int: 0 (null) / 1
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001259mpi_div_int:"":1:"":"":0
Gilles Peskine36374882021-06-08 23:01:13 +02001260
Werner Lewis6baf12b2022-10-19 12:46:35 +01001261Base test mbedtls_mpi_mod_mpi #1
1262mpi_mod_mpi:"3e8":"d":"c":0
1263
1264Base test mbedtls_mpi_mod_mpi #2 (Divide by zero (null))
1265mpi_mod_mpi:"3e8":"":"0":MBEDTLS_ERR_MPI_DIVISION_BY_ZERO
1266
1267Base test mbedtls_mpi_mod_mpi #2 (Divide by zero (1 limb))
1268mpi_mod_mpi:"3e8":"0":"0":MBEDTLS_ERR_MPI_DIVISION_BY_ZERO
1269
1270Base test mbedtls_mpi_mod_mpi #3
1271mpi_mod_mpi:"-3e8":"d":"1":0
1272
1273Base test mbedtls_mpi_mod_mpi #4 (Negative modulo)
1274mpi_mod_mpi:"3e8":"-d":"-1":MBEDTLS_ERR_MPI_NEGATIVE_VALUE
1275
1276Base test mbedtls_mpi_mod_mpi #5 (Negative modulo)
1277mpi_mod_mpi:"-3e8":"-d":"-c":MBEDTLS_ERR_MPI_NEGATIVE_VALUE
1278
1279Test mbedtls_mpi_mod_mpi: 0 (null) % 1
1280mpi_mod_mpi:"":"1":"":0
1281
1282Test mbedtls_mpi_mod_mpi: 0 (null) % -1
1283mpi_mod_mpi:"":"-1":"":MBEDTLS_ERR_MPI_NEGATIVE_VALUE
1284
1285Base test mbedtls_mpi_mod_int #1
1286mpi_mod_int:"3e8":13:12:0
1287
1288Base test mbedtls_mpi_mod_int #2 (Divide by zero)
1289mpi_mod_int:"3e8":0:0:MBEDTLS_ERR_MPI_DIVISION_BY_ZERO
1290
1291Base test mbedtls_mpi_mod_int #3
1292mpi_mod_int:"-3e8":13:1:0
1293
1294Base test mbedtls_mpi_mod_int #4 (Negative modulo)
1295mpi_mod_int:"3e8":-13:0:MBEDTLS_ERR_MPI_NEGATIVE_VALUE
1296
1297Base test mbedtls_mpi_mod_int #5 (Negative modulo)
1298mpi_mod_int:"-3e8":-13:0:MBEDTLS_ERR_MPI_NEGATIVE_VALUE
1299
1300Base test mbedtls_mpi_mod_int #6 (By 1)
1301mpi_mod_int:"3e8":1:0:0
1302
1303Base test mbedtls_mpi_mod_int #7 (By 2)
1304mpi_mod_int:"3e9":2:1:0
1305
1306Base test mbedtls_mpi_mod_int #8 (By 2)
1307mpi_mod_int:"3e8":2:0:0
1308
1309Test mbedtls_mpi_mod_int: 0 (null) % 1
1310mpi_mod_int:"":1:0:0
1311
1312Test mbedtls_mpi_mod_int: 0 (null) % 2
1313mpi_mod_int:"":2:0:0
1314
1315Test mbedtls_mpi_mod_int: 0 (null) % -1
1316mpi_mod_int:"":-1:0:MBEDTLS_ERR_MPI_NEGATIVE_VALUE
1317
1318Test mbedtls_mpi_mod_int: 0 (null) % -2
1319mpi_mod_int:"":-2:0:MBEDTLS_ERR_MPI_NEGATIVE_VALUE
1320
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001321Base test mbedtls_mpi_exp_mod #1
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001322mpi_exp_mod:"17":"d":"1d":"18":0
Paul Bakker367dae42009-06-28 21:50:27 +00001323
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001324Base test mbedtls_mpi_exp_mod #2 (Even N)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001325mpi_exp_mod:"17":"d":"1e":"0":MBEDTLS_ERR_MPI_BAD_INPUT_DATA
Paul Bakker367dae42009-06-28 21:50:27 +00001326
Gilles Peskine36374882021-06-08 23:01:13 +02001327Base test mbedtls_mpi_exp_mod #2 (N = 0 (null))
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001328mpi_exp_mod:"17":"d":"":"0":MBEDTLS_ERR_MPI_BAD_INPUT_DATA
Gilles Peskine36374882021-06-08 23:01:13 +02001329
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001330Base test mbedtls_mpi_exp_mod #3 (Negative N)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001331mpi_exp_mod:"17":"d":"-1d":"0":MBEDTLS_ERR_MPI_BAD_INPUT_DATA
Paul Bakkerf6198c12012-05-16 08:02:29 +00001332
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001333Base test mbedtls_mpi_exp_mod #4 (Negative base)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001334mpi_exp_mod:"-17":"d":"1d":"5":0
Paul Bakkerf6198c12012-05-16 08:02:29 +00001335
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001336Base test mbedtls_mpi_exp_mod #5 (Negative exponent)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001337mpi_exp_mod:"17":"-d":"1d":"0":MBEDTLS_ERR_MPI_BAD_INPUT_DATA
Paul Bakkerf6198c12012-05-16 08:02:29 +00001338
Chris Jones0c5875f2020-11-26 11:21:53 +00001339Base test mbedtls_mpi_exp_mod #6 (Negative base + exponent)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001340mpi_exp_mod:"-17":"-d":"1d":"0":MBEDTLS_ERR_MPI_BAD_INPUT_DATA
Paul Bakker367dae42009-06-28 21:50:27 +00001341
Gilles Peskine36374882021-06-08 23:01:13 +02001342Test mbedtls_mpi_exp_mod: 0 (null) ^ 0 (null) mod 9
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001343mpi_exp_mod:"":"":"09":"1":0
Gilles Peskine36374882021-06-08 23:01:13 +02001344
1345Test mbedtls_mpi_exp_mod: 0 (null) ^ 0 (1 limb) mod 9
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001346mpi_exp_mod:"":"00":"09":"1":0
Gilles Peskine36374882021-06-08 23:01:13 +02001347
1348Test mbedtls_mpi_exp_mod: 0 (null) ^ 1 mod 9
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001349mpi_exp_mod:"":"01":"09":"":0
Gilles Peskine36374882021-06-08 23:01:13 +02001350
1351Test mbedtls_mpi_exp_mod: 0 (null) ^ 2 mod 9
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001352mpi_exp_mod:"":"02":"09":"":0
Gilles Peskine36374882021-06-08 23:01:13 +02001353
1354Test mbedtls_mpi_exp_mod: 0 (1 limb) ^ 0 (null) mod 9
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001355mpi_exp_mod:"00":"":"09":"1":0
Gilles Peskine36374882021-06-08 23:01:13 +02001356
1357Test mbedtls_mpi_exp_mod: 0 (1 limb) ^ 0 (1 limb) mod 9
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001358mpi_exp_mod:"00":"00":"09":"1":0
Gilles Peskine36374882021-06-08 23:01:13 +02001359
1360Test mbedtls_mpi_exp_mod: 0 (1 limb) ^ 1 mod 9
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001361mpi_exp_mod:"00":"01":"09":"":0
Gilles Peskine36374882021-06-08 23:01:13 +02001362
1363Test mbedtls_mpi_exp_mod: 0 (1 limb) ^ 2 mod 9
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001364mpi_exp_mod:"00":"02":"09":"":0
Gilles Peskine36374882021-06-08 23:01:13 +02001365
1366Test mbedtls_mpi_exp_mod: 1 ^ 0 (null) mod 9
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001367mpi_exp_mod:"01":"":"09":"1":0
Gilles Peskine36374882021-06-08 23:01:13 +02001368
1369Test mbedtls_mpi_exp_mod: 4 ^ 0 (null) mod 9
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001370mpi_exp_mod:"04":"":"09":"1":0
Gilles Peskine36374882021-06-08 23:01:13 +02001371
1372Test mbedtls_mpi_exp_mod: 10 ^ 0 (null) mod 9
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001373mpi_exp_mod:"0a":"":"09":"1":0
Gilles Peskine36374882021-06-08 23:01:13 +02001374
1375Test mbedtls_mpi_exp_mod: 1 ^ 0 (1 limb) mod 9
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001376mpi_exp_mod:"01":"00":"09":"1":0
Gilles Peskine36374882021-06-08 23:01:13 +02001377
1378Test mbedtls_mpi_exp_mod: 4 ^ 0 (1 limb) mod 9
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001379mpi_exp_mod:"04":"00":"09":"1":0
Gilles Peskine36374882021-06-08 23:01:13 +02001380
1381Test mbedtls_mpi_exp_mod: 10 ^ 0 (1 limb) mod 9
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001382mpi_exp_mod:"0a":"00":"09":"1":0
Gilles Peskine36374882021-06-08 23:01:13 +02001383
Chris Jonesaa850cd2020-12-03 11:35:41 +00001384Test mbedtls_mpi_exp_mod: MAX_SIZE exponent
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001385mpi_exp_mod_size:2:MBEDTLS_MPI_MAX_SIZE:10:"":0
Chris Jonesd10b3312020-12-02 10:41:50 +00001386
Chris Jonesaa850cd2020-12-03 11:35:41 +00001387Test mbedtls_mpi_exp_mod: MAX_SIZE + 1 exponent
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001388mpi_exp_mod_size:2:MBEDTLS_MPI_MAX_SIZE + 1:10:"":MBEDTLS_ERR_MPI_BAD_INPUT_DATA
Chris Jonesd10b3312020-12-02 10:41:50 +00001389
Chris Jonesaa850cd2020-12-03 11:35:41 +00001390Test mbedtls_mpi_exp_mod: MAX_SIZE modulus
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001391mpi_exp_mod_size:2:2:MBEDTLS_MPI_MAX_SIZE:"":0
Chris Jonesd10b3312020-12-02 10:41:50 +00001392
Chris Jonesaa850cd2020-12-03 11:35:41 +00001393Test mbedtls_mpi_exp_mod: MAX_SIZE + 1 modulus
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001394mpi_exp_mod_size:2:2:MBEDTLS_MPI_MAX_SIZE + 1:"":MBEDTLS_ERR_MPI_BAD_INPUT_DATA
Chris Jones0c5875f2020-11-26 11:21:53 +00001395
Chris Jonesaa850cd2020-12-03 11:35:41 +00001396Test mbedtls_mpi_exp_mod: MAX_SIZE exponent and modulus
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001397mpi_exp_mod_size:2:MBEDTLS_MPI_MAX_SIZE:MBEDTLS_MPI_MAX_SIZE:"":0
Chris Jonesa03f56f2020-12-02 16:27:42 +00001398
Chris Jonesaa850cd2020-12-03 11:35:41 +00001399Test mbedtls_mpi_exp_mod: MAX_SIZE + 1 exponent and modulus
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001400mpi_exp_mod_size:2:MBEDTLS_MPI_MAX_SIZE + 1:MBEDTLS_MPI_MAX_SIZE + 1:"":MBEDTLS_ERR_MPI_BAD_INPUT_DATA
Chris Jonesa03f56f2020-12-02 16:27:42 +00001401
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001402Test mbedtls_mpi_exp_mod #1
Chris Jonese64a46f2020-12-03 17:44:03 +00001403depends_on:MPI_MAX_BITS_LARGER_THAN_792
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001404mpi_exp_mod:"109fe45714866e56fdd4ad9b6b686df27224afb7868cf4f0cbb794526932853cbf0beea61594166654d13cd9fe0d9da594a97ee20230f12fb5434de73fb4f8102725a01622b31b1ea42e3a265019039ac1df31869bd97930d792fb72cdaa971d8a8015af":"33ae3764fd06a00cdc3cba5c45dc79a9edb4e67e4d057cc74139d531c25190d111775fc4a0f4439b8b1930bbd766e7b46f170601f316c8a18ff8d5cb5ca5581f168345d101edb462b7d93b7c520ccb8fb276b447a63d869203cc11f67a1122dc4da034218de85e39":"11a9351d2d32ccd568e75bf8b4ebbb2a36be691b55832edac662ff79803df8af525fba453068be16ac3920bcc1b468f8f7fe786e0fa4ecbabcad31e5e3b05def802eb8600deaf11ef452487db878df20a80606e4bb6a163b83895d034cc8b53dbcd005be42ffdd2ce99bed06089a0b79d":"37880b547b41bda303bddda307eefe24b4aedf076c9b814b903aaf328a10825c7e259a20afc6b70b487bb21a6d32d0ee98a0b9f42ff812c901e2f79237fe3e00856992dd69d93ebc0664c75863829621751b0ac35a8ae8a0965841607d3099b8e0ed24442749ba09acbcb165598dcd40":0
Paul Bakker367dae42009-06-28 21:50:27 +00001405
Gilles Peskineefa2ac82019-09-19 21:20:26 +02001406Test mbedtls_mpi_exp_mod (Negative base) [#1]
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001407mpi_exp_mod:"-2540be400":"2540be400":"1869f":"1":0
Paul Bakkerf6198c12012-05-16 08:02:29 +00001408
Gilles Peskineefa2ac82019-09-19 21:20:26 +02001409Test mbedtls_mpi_exp_mod (Negative base) [#2]
Chris Jonese64a46f2020-12-03 17:44:03 +00001410depends_on:MPI_MAX_BITS_LARGER_THAN_792
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001411mpi_exp_mod:"-9f13012cd92aa72fb86ac8879d2fde4f7fd661aaae43a00971f081cc60ca277059d5c37e89652e2af2585d281d66ef6a9d38a117e9608e9e7574cd142dc55278838a2161dd56db9470d4c1da2d5df15a908ee2eb886aaa890f23be16de59386663a12f1afbb325431a3e835e3fd89b98b96a6f77382f458ef9a37e1f84a03045c8676ab55291a94c2228ea15448ee96b626b998":"40a54d1b9e86789f06d9607fb158672d64867665c73ee9abb545fc7a785634b354c7bae5b962ce8040cf45f2c1f3d3659b2ee5ede17534c8fc2ec85c815e8df1fe7048d12c90ee31b88a68a081f17f0d8ce5f4030521e9400083bcea73a429031d4ca7949c2000d597088e0c39a6014d8bf962b73bb2e8083bd0390a4e00b9b3":"eeaf0ab9adb38dd69c33f80afa8fc5e86072618775ff3c0b9ea2314c9c256576d674df7496ea81d3383b4813d692c6e0e0d5d8e250b98be48e495c1d6089dad15dc7d7b46154d6b6ce8ef4ad69b15d4982559b297bcf1885c529f566660e57ec68edbc3c05726cc02fd4cbf4976eaa9afd5138fe8376435b9fc61d2fc0eb06e3":"21acc7199e1b90f9b4844ffe12c19f00ec548c5d32b21c647d48b6015d8eb9ec9db05b4f3d44db4227a2b5659c1a7cceb9d5fa8fa60376047953ce7397d90aaeb7465e14e820734f84aa52ad0fc66701bcbb991d57715806a11531268e1e83dd48288c72b424a6287e9ce4e5cc4db0dd67614aecc23b0124a5776d36e5c89483":0
Paul Bakkerf6198c12012-05-16 08:02:29 +00001412
Paul Bakker367dae42009-06-28 21:50:27 +00001413Base test GCD #1
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001414mpi_gcd:"2b5":"261":"15"
Paul Bakker367dae42009-06-28 21:50:27 +00001415
1416Base test GCD #2
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001417mpi_gcd:"6e4":"364":"1c"
Paul Bakker367dae42009-06-28 21:50:27 +00001418
1419Base test GCD #3
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001420mpi_gcd:"2dcdb10b":"2050d306":"1"
Paul Bakker367dae42009-06-28 21:50:27 +00001421
Gilles Peskine36374882021-06-08 23:01:13 +02001422Test GCD: 0 (null), 0 (null)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001423mpi_gcd:"":"":"0"
Gilles Peskine36374882021-06-08 23:01:13 +02001424
1425Test GCD: 0 (null), 0 (1 limb)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001426mpi_gcd:"":"00":"0"
Gilles Peskine36374882021-06-08 23:01:13 +02001427
1428Test GCD: 0 (null), 3
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001429mpi_gcd:"":"03":"3"
Gilles Peskine36374882021-06-08 23:01:13 +02001430
1431Test GCD: 0 (null), 6
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001432mpi_gcd:"":"06":"6"
Gilles Peskine36374882021-06-08 23:01:13 +02001433
1434Test GCD: 0 (1 limb), 0 (null)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001435mpi_gcd:"00":"":"0"
Gilles Peskine36374882021-06-08 23:01:13 +02001436
1437Test GCD: 0 (1 limb), 3
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001438mpi_gcd:"00":"03":"3"
Gilles Peskine36374882021-06-08 23:01:13 +02001439
1440Test GCD: 0 (1 limb), 6
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001441mpi_gcd:"00":"06":"6"
Gilles Peskine36374882021-06-08 23:01:13 +02001442
1443Test GCD: 3, 0 (null)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001444mpi_gcd:"03":"":"3"
Gilles Peskine36374882021-06-08 23:01:13 +02001445
1446Test GCD: 3, 0 (1 limb)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001447mpi_gcd:"03":"00":"3"
Gilles Peskine36374882021-06-08 23:01:13 +02001448
1449Test GCD: 6, 0 (null)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001450mpi_gcd:"06":"":"6"
Gilles Peskine36374882021-06-08 23:01:13 +02001451
1452Test GCD: 6, 0 (1 limb)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001453mpi_gcd:"06":"00":"6"
Gilles Peskine36374882021-06-08 23:01:13 +02001454
Gilles Peskine9466d812021-06-15 21:10:16 +02001455Test GCD: gcd=1, 0 < A < B
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001456mpi_gcd:"109fe45714866e56fdd4ad9b6b686df27224afb7868cf4f0cbb794526932853cbf0beea61594166654d13cd9fe0d9da594a97ee20230f12fb5434de73fb4f8102725a01622b31b1ea42e3a265019039ac1df31869bd97930d792fb72cdaa971d8a8015af":"33ae3764fd06a00cdc3cba5c45dc79a9edb4e67e4d057cc74139d531c25190d111775fc4a0f4439b8b1930bbd766e7b46f170601f316c8a18ff8d5cb5ca5581f168345d101edb462b7d93b7c520ccb8fb276b447a63d869203cc11f67a1122dc4da034218de85e39":"1"
Paul Bakker367dae42009-06-28 21:50:27 +00001457
Gilles Peskine9466d812021-06-15 21:10:16 +02001458Test GCD: gcd=1, 0 < B < A
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001459mpi_gcd:"33ae3764fd06a00cdc3cba5c45dc79a9edb4e67e4d057cc74139d531c25190d111775fc4a0f4439b8b1930bbd766e7b46f170601f316c8a18ff8d5cb5ca5581f168345d101edb462b7d93b7c520ccb8fb276b447a63d869203cc11f67a1122dc4da034218de85e39":"109fe45714866e56fdd4ad9b6b686df27224afb7868cf4f0cbb794526932853cbf0beea61594166654d13cd9fe0d9da594a97ee20230f12fb5434de73fb4f8102725a01622b31b1ea42e3a265019039ac1df31869bd97930d792fb72cdaa971d8a8015af":"1"
Gilles Peskine9e9314f2021-06-09 10:52:12 +02001460
Gilles Peskine9466d812021-06-15 21:10:16 +02001461Test GCD: gcd=1, A > 0, B < 0
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001462mpi_gcd:"109fe45714866e56fdd4ad9b6b686df27224afb7868cf4f0cbb794526932853cbf0beea61594166654d13cd9fe0d9da594a97ee20230f12fb5434de73fb4f8102725a01622b31b1ea42e3a265019039ac1df31869bd97930d792fb72cdaa971d8a8015af":"-33ae3764fd06a00cdc3cba5c45dc79a9edb4e67e4d057cc74139d531c25190d111775fc4a0f4439b8b1930bbd766e7b46f170601f316c8a18ff8d5cb5ca5581f168345d101edb462b7d93b7c520ccb8fb276b447a63d869203cc11f67a1122dc4da034218de85e39":"1"
Gilles Peskine9e9314f2021-06-09 10:52:12 +02001463
Gilles Peskine9466d812021-06-15 21:10:16 +02001464Test GCD: gcd=1, A < 0 < B, |A| < |B|
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001465mpi_gcd:"-109fe45714866e56fdd4ad9b6b686df27224afb7868cf4f0cbb794526932853cbf0beea61594166654d13cd9fe0d9da594a97ee20230f12fb5434de73fb4f8102725a01622b31b1ea42e3a265019039ac1df31869bd97930d792fb72cdaa971d8a8015af":"33ae3764fd06a00cdc3cba5c45dc79a9edb4e67e4d057cc74139d531c25190d111775fc4a0f4439b8b1930bbd766e7b46f170601f316c8a18ff8d5cb5ca5581f168345d101edb462b7d93b7c520ccb8fb276b447a63d869203cc11f67a1122dc4da034218de85e39":"1"
Gilles Peskine9e9314f2021-06-09 10:52:12 +02001466
Gilles Peskine9466d812021-06-15 21:10:16 +02001467Test GCD: gcd=1, B < A < 0
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001468mpi_gcd:"-109fe45714866e56fdd4ad9b6b686df27224afb7868cf4f0cbb794526932853cbf0beea61594166654d13cd9fe0d9da594a97ee20230f12fb5434de73fb4f8102725a01622b31b1ea42e3a265019039ac1df31869bd97930d792fb72cdaa971d8a8015af":"-33ae3764fd06a00cdc3cba5c45dc79a9edb4e67e4d057cc74139d531c25190d111775fc4a0f4439b8b1930bbd766e7b46f170601f316c8a18ff8d5cb5ca5581f168345d101edb462b7d93b7c520ccb8fb276b447a63d869203cc11f67a1122dc4da034218de85e39":"1"
Gilles Peskine9e9314f2021-06-09 10:52:12 +02001469
Gilles Peskine9466d812021-06-15 21:10:16 +02001470Test GCD: gcd=2, 0 < A < B
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001471mpi_gcd:"213fc8ae290cdcadfba95b36d6d0dbe4e4495f6f0d19e9e1976f28a4d2650a797e17dd4c2b282ccca9a279b3fc1b3b4b2952fdc40461e25f6a869bce7f69f0204e4b402c4566363d485c744ca032073583be630d37b2f261af25f6e59b552e3b15002b5e":"675c6ec9fa0d4019b87974b88bb8f353db69ccfc9a0af98e8273aa6384a321a222eebf8941e8873716326177aecdcf68de2e0c03e62d91431ff1ab96b94ab03e2d068ba203db68c56fb276f8a419971f64ed688f4c7b0d24079823ecf42245b89b4068431bd0bc72":"2"
Gilles Peskine9e9314f2021-06-09 10:52:12 +02001472
Gilles Peskine9466d812021-06-15 21:10:16 +02001473Test GCD: gcd=2, 0 < B < A
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001474mpi_gcd:"675c6ec9fa0d4019b87974b88bb8f353db69ccfc9a0af98e8273aa6384a321a222eebf8941e8873716326177aecdcf68de2e0c03e62d91431ff1ab96b94ab03e2d068ba203db68c56fb276f8a419971f64ed688f4c7b0d24079823ecf42245b89b4068431bd0bc72":"213fc8ae290cdcadfba95b36d6d0dbe4e4495f6f0d19e9e1976f28a4d2650a797e17dd4c2b282ccca9a279b3fc1b3b4b2952fdc40461e25f6a869bce7f69f0204e4b402c4566363d485c744ca032073583be630d37b2f261af25f6e59b552e3b15002b5e":"2"
Gilles Peskine9e9314f2021-06-09 10:52:12 +02001475
Gilles Peskine9466d812021-06-15 21:10:16 +02001476Test GCD: gcd=3, 0 < A < B
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001477mpi_gcd:"31dfad053d934b04f97e08d2423949d7566e0f2693a6ded26326bcf73b978fb63d23cbf240bc4332fe73b68dfa28d8f0bdfc7ca60692d38f1fc9e9b5bf1ee8307570e0426819515bec8aae72f04b0ad0459d9493d38c6b9286b8f25868ffc5589f80410d":"9b0aa62ef713e02694b62f14d1956cfdc91eb37ae7107655c3ad7f9546f4b27334661f4de2dccad2a14b92338634b71d4d451205d94459e4afea816215f0085d4389d17305c91d28278bb274f62662af17641cd6f2b893b60b6435e36e336894e8e09c64a9b91aab":"3"
Gilles Peskine9e9314f2021-06-09 10:52:12 +02001478
Gilles Peskine9466d812021-06-15 21:10:16 +02001479Test GCD: gcd=3, 0 < B < A
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001480mpi_gcd:"9b0aa62ef713e02694b62f14d1956cfdc91eb37ae7107655c3ad7f9546f4b27334661f4de2dccad2a14b92338634b71d4d451205d94459e4afea816215f0085d4389d17305c91d28278bb274f62662af17641cd6f2b893b60b6435e36e336894e8e09c64a9b91aab":"31dfad053d934b04f97e08d2423949d7566e0f2693a6ded26326bcf73b978fb63d23cbf240bc4332fe73b68dfa28d8f0bdfc7ca60692d38f1fc9e9b5bf1ee8307570e0426819515bec8aae72f04b0ad0459d9493d38c6b9286b8f25868ffc5589f80410d":"3"
Gilles Peskine9e9314f2021-06-09 10:52:12 +02001481
Gilles Peskine9466d812021-06-15 21:10:16 +02001482Test GCD: gcd=4, 0 < A < B
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001483mpi_gcd:"427f915c5219b95bf752b66dada1b7c9c892bede1a33d3c32ede5149a4ca14f2fc2fba98565059995344f367f836769652a5fb8808c3c4bed50d379cfed3e0409c9680588acc6c7a90b8e89940640e6b077cc61a6f65e4c35e4bedcb36aa5c762a0056bc":"ceb8dd93f41a803370f2e9711771e6a7b6d399f93415f31d04e754c70946434445dd7f1283d10e6e2c64c2ef5d9b9ed1bc5c1807cc5b22863fe3572d7295607c5a0d174407b6d18adf64edf148332e3ec9dad11e98f61a480f3047d9e8448b713680d08637a178e4":"4"
Gilles Peskine9e9314f2021-06-09 10:52:12 +02001484
Gilles Peskine9466d812021-06-15 21:10:16 +02001485Test GCD: gcd=4, 0 < B < A
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001486mpi_gcd:"ceb8dd93f41a803370f2e9711771e6a7b6d399f93415f31d04e754c70946434445dd7f1283d10e6e2c64c2ef5d9b9ed1bc5c1807cc5b22863fe3572d7295607c5a0d174407b6d18adf64edf148332e3ec9dad11e98f61a480f3047d9e8448b713680d08637a178e4":"427f915c5219b95bf752b66dada1b7c9c892bede1a33d3c32ede5149a4ca14f2fc2fba98565059995344f367f836769652a5fb8808c3c4bed50d379cfed3e0409c9680588acc6c7a90b8e89940640e6b077cc61a6f65e4c35e4bedcb36aa5c762a0056bc":"4"
Gilles Peskine9e9314f2021-06-09 10:52:12 +02001487
Gilles Peskine9466d812021-06-15 21:10:16 +02001488Test GCD: gcd=6, 0 < A < B
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001489mpi_gcd:"63bf5a0a7b269609f2fc11a4847293aeacdc1e4d274dbda4c64d79ee772f1f6c7a4797e481788665fce76d1bf451b1e17bf8f94c0d25a71e3f93d36b7e3dd060eae1c084d032a2b7d9155ce5e09615a08b3b2927a718d7250d71e4b0d1ff8ab13f00821a":"136154c5dee27c04d296c5e29a32ad9fb923d66f5ce20ecab875aff2a8de964e668cc3e9bc5b995a5429724670c696e3a9a8a240bb288b3c95fd502c42be010ba8713a2e60b923a504f1764e9ec4cc55e2ec839ade571276c16c86bc6dc66d129d1c138c953723556":"6"
Gilles Peskine9e9314f2021-06-09 10:52:12 +02001490
Gilles Peskine9466d812021-06-15 21:10:16 +02001491Test GCD: gcd=6, 0 < B < A
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001492mpi_gcd:"136154c5dee27c04d296c5e29a32ad9fb923d66f5ce20ecab875aff2a8de964e668cc3e9bc5b995a5429724670c696e3a9a8a240bb288b3c95fd502c42be010ba8713a2e60b923a504f1764e9ec4cc55e2ec839ade571276c16c86bc6dc66d129d1c138c953723556":"63bf5a0a7b269609f2fc11a4847293aeacdc1e4d274dbda4c64d79ee772f1f6c7a4797e481788665fce76d1bf451b1e17bf8f94c0d25a71e3f93d36b7e3dd060eae1c084d032a2b7d9155ce5e09615a08b3b2927a718d7250d71e4b0d1ff8ab13f00821a":"6"
Gilles Peskine9e9314f2021-06-09 10:52:12 +02001493
Gilles Peskine3f1c3c92021-06-15 21:10:50 +02001494Test GCD: 0 < A = B
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001495mpi_gcd:"109fe45714866e56fdd4ad9b6b686df27224afb7868cf4f0cbb794526932853cbf0beea61594166654d13cd9fe0d9da594a97ee20230f12fb5434de73fb4f8102725a01622b31b1ea42e3a265019039ac1df31869bd97930d792fb72cdaa971d8a8015af":"109fe45714866e56fdd4ad9b6b686df27224afb7868cf4f0cbb794526932853cbf0beea61594166654d13cd9fe0d9da594a97ee20230f12fb5434de73fb4f8102725a01622b31b1ea42e3a265019039ac1df31869bd97930d792fb72cdaa971d8a8015af":"109fe45714866e56fdd4ad9b6b686df27224afb7868cf4f0cbb794526932853cbf0beea61594166654d13cd9fe0d9da594a97ee20230f12fb5434de73fb4f8102725a01622b31b1ea42e3a265019039ac1df31869bd97930d792fb72cdaa971d8a8015af"
Gilles Peskine3f1c3c92021-06-15 21:10:50 +02001496
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001497Base test mbedtls_mpi_inv_mod #1
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001498mpi_inv_mod:"3":"b":"4":0
Paul Bakker367dae42009-06-28 21:50:27 +00001499
Gilles Peskine36374882021-06-08 23:01:13 +02001500Test mbedtls_mpi_inv_mod: mod 0 (null)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001501mpi_inv_mod:"3":"":"0":MBEDTLS_ERR_MPI_BAD_INPUT_DATA
Gilles Peskine36374882021-06-08 23:01:13 +02001502
Gilles Peskine5fb6f702021-06-08 23:00:17 +02001503Test mbedtls_mpi_inv_mod: mod 0 (1 limb)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001504mpi_inv_mod:"3":"0":"0":MBEDTLS_ERR_MPI_BAD_INPUT_DATA
Paul Bakker367dae42009-06-28 21:50:27 +00001505
Gilles Peskine5fb6f702021-06-08 23:00:17 +02001506Test mbedtls_mpi_inv_mod: mod negative
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001507mpi_inv_mod:"3":"-b":"4":MBEDTLS_ERR_MPI_BAD_INPUT_DATA
Paul Bakker367dae42009-06-28 21:50:27 +00001508
Gilles Peskine5fb6f702021-06-08 23:00:17 +02001509Test mbedtls_mpi_inv_mod: 2^-1 mod 4
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001510mpi_inv_mod:"2":"4":"0":MBEDTLS_ERR_MPI_NOT_ACCEPTABLE
Paul Bakker367dae42009-06-28 21:50:27 +00001511
Gilles Peskine5fb6f702021-06-08 23:00:17 +02001512Test mbedtls_mpi_inv_mod: mod 1
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001513mpi_inv_mod:"3":"1":"0":MBEDTLS_ERR_MPI_BAD_INPUT_DATA
Hanno Becker4bcb4912017-04-18 15:49:39 +01001514
Gilles Peskine36374882021-06-08 23:01:13 +02001515Test mbedtls_mpi_inv_mod: 0 (null) ^-1
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001516mpi_inv_mod:"":"11":"":MBEDTLS_ERR_MPI_NOT_ACCEPTABLE
Gilles Peskine36374882021-06-08 23:01:13 +02001517
1518Test mbedtls_mpi_inv_mod: 0 (1 limb) ^-1
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001519mpi_inv_mod:"00":"11":"":MBEDTLS_ERR_MPI_NOT_ACCEPTABLE
Gilles Peskine36374882021-06-08 23:01:13 +02001520
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001521Test mbedtls_mpi_inv_mod #1
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001522mpi_inv_mod:"aa4df5cb14b4c31237f98bd1faf527c283c2d0f3eec89718664ba33f9762907c":"fffbbd660b94412ae61ead9c2906a344116e316a256fd387874c6c675b1d587d":"8d6a5c1d7adeae3e94b9bcd2c47e0d46e778bc8804a2cc25c02d775dc3d05b0c":0
Paul Bakker367dae42009-06-28 21:50:27 +00001523
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001524Base test mbedtls_mpi_is_prime #1
1525depends_on:MBEDTLS_GENPRIME
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001526mpi_is_prime:"0":MBEDTLS_ERR_MPI_NOT_ACCEPTABLE
Paul Bakker367dae42009-06-28 21:50:27 +00001527
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001528Base test mbedtls_mpi_is_prime #2
1529depends_on:MBEDTLS_GENPRIME
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001530mpi_is_prime:"1":MBEDTLS_ERR_MPI_NOT_ACCEPTABLE
Paul Bakker367dae42009-06-28 21:50:27 +00001531
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001532Base test mbedtls_mpi_is_prime #3
1533depends_on:MBEDTLS_GENPRIME
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001534mpi_is_prime:"2":0
Paul Bakker367dae42009-06-28 21:50:27 +00001535
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001536Base test mbedtls_mpi_is_prime #4
1537depends_on:MBEDTLS_GENPRIME
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001538mpi_is_prime:"3":0
Paul Bakker367dae42009-06-28 21:50:27 +00001539
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001540Base test mbedtls_mpi_is_prime #5
1541depends_on:MBEDTLS_GENPRIME
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001542mpi_is_prime:"4":MBEDTLS_ERR_MPI_NOT_ACCEPTABLE
Paul Bakker367dae42009-06-28 21:50:27 +00001543
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001544Base test mbedtls_mpi_is_prime #6
1545depends_on:MBEDTLS_GENPRIME
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001546mpi_is_prime:"5":0
Paul Bakker367dae42009-06-28 21:50:27 +00001547
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001548Base test mbedtls_mpi_is_prime #7
1549depends_on:MBEDTLS_GENPRIME
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001550mpi_is_prime:"1b":MBEDTLS_ERR_MPI_NOT_ACCEPTABLE
Paul Bakker367dae42009-06-28 21:50:27 +00001551
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001552Base test mbedtls_mpi_is_prime #8
1553depends_on:MBEDTLS_GENPRIME
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001554mpi_is_prime:"2f":0
Paul Bakker367dae42009-06-28 21:50:27 +00001555
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001556Test mbedtls_mpi_is_prime #1a
1557depends_on:MBEDTLS_GENPRIME
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001558mpi_is_prime:"b91ba63180c726fbd57786f27f1ede97a3b40c59a7fcfb5898f076e9af57028d":MBEDTLS_ERR_MPI_NOT_ACCEPTABLE
Manuel Pégourié-Gonnard378fb4b2013-11-22 18:39:18 +01001559
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001560Test mbedtls_mpi_is_prime #1b
1561depends_on:MBEDTLS_GENPRIME
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001562mpi_is_prime:"b3a119602ee213cde28581ecd892e0f592a338655dce4ca88054b3d124d0e561":MBEDTLS_ERR_MPI_NOT_ACCEPTABLE
Manuel Pégourié-Gonnard378fb4b2013-11-22 18:39:18 +01001563
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001564Test mbedtls_mpi_is_prime #2a
1565depends_on:MBEDTLS_GENPRIME
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001566mpi_is_prime:"284139ea19c139ebe09a8111926aaa39a2c2be12ed487a809d3cb5bc55854725b4cdcb5734c58f90b2f60d99cc1950cdbc8d651793e93c9c6f0ead752500a32c56c62082912b66132b2a6aa42ada923e1ad22ceb7ba0123":0
Paul Bakker367dae42009-06-28 21:50:27 +00001567
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001568Test mbedtls_mpi_is_prime #2b
1569depends_on:MBEDTLS_GENPRIME
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001570mpi_is_prime:"284139ea19c139ebe09a8111926aaa39a2c2be12ed487a809d3cb5bc55854725b4cdcb5734c58f90b2f60d99cc1950cdbc8d651793e93c9c6f0ead752500a32c56c62082912b66132b2a6aa42ada923e1ad22ceb7ba00c1":MBEDTLS_ERR_MPI_NOT_ACCEPTABLE
Paul Bakkere896fea2009-07-06 06:40:23 +00001571
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001572Test mbedtls_mpi_is_prime #3
1573depends_on:MBEDTLS_GENPRIME
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001574mpi_is_prime:"257ffffffffffffffffff":0
Paul Bakkerba48cb22009-07-12 11:01:32 +00001575
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001576Test mbedtls_mpi_is_prime #4
1577depends_on:MBEDTLS_GENPRIME
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001578mpi_is_prime:"a1ffffffffffffffffffff":0
Paul Bakkerba48cb22009-07-12 11:01:32 +00001579
Gilles Peskineefa2ac82019-09-19 21:20:26 +02001580Test mbedtls_mpi_is_prime #5 [#1]
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001581depends_on:MBEDTLS_GENPRIME
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001582mpi_is_prime:"397ffffffffffffffffffffffffffff":0
Paul Bakkerba48cb22009-07-12 11:01:32 +00001583
Gilles Peskineefa2ac82019-09-19 21:20:26 +02001584Test mbedtls_mpi_is_prime #5 [#2]
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001585depends_on:MBEDTLS_GENPRIME
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001586mpi_is_prime:"aaaaaaaaaaaaaab":0
Paul Bakkerba48cb22009-07-12 11:01:32 +00001587
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001588Test mbedtls_mpi_is_prime #6
1589depends_on:MBEDTLS_GENPRIME
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001590mpi_is_prime:"2aaaaaaaaaaaaaaaaaab":0
Paul Bakkerba48cb22009-07-12 11:01:32 +00001591
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001592Test mbedtls_mpi_is_prime #7
1593depends_on:MBEDTLS_GENPRIME
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001594mpi_is_prime:"aaaaaaaaaaaaaaaaaaaaaaaab":0
Paul Bakkerba48cb22009-07-12 11:01:32 +00001595
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001596Test mbedtls_mpi_is_prime #8
1597depends_on:MBEDTLS_GENPRIME
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001598mpi_is_prime:"2aaaaaaaaaaaaaaaaaaaaaaaaaaaaaab":0
Paul Bakkerba48cb22009-07-12 11:01:32 +00001599
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001600Test mbedtls_mpi_is_prime #9
1601depends_on:MBEDTLS_GENPRIME
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001602mpi_is_prime:"4df72d07b4b71c8dacb6cffa954f8d88254b6277099308baf003fab73227f34029643b5a263f66e0d3c3fa297ef71755efd53b8fb6cb812c6bbf7bcf179298bd9947c4c8b14324140a2c0f5fad7958a69050a987a6096e9f055fb38edf0c5889eca4a0cfa99b45fbdeee4c696b328ddceae4723945901ec025076b12b":0
Paul Bakkerba48cb22009-07-12 11:01:32 +00001603
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001604Test mbedtls_mpi_is_prime #10
1605depends_on:MBEDTLS_GENPRIME
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001606mpi_is_prime:"cb50e82a8583f44ee0025942e7362991b24e12663a0ddc234a57b0f7b4ff7b025bf5a6707dedc2898e70b739042c95a996283dffdf67558768784553c61e302e8812bc90f0bb0696870cfb910b560cefed8d99bbf7a00b31ccdbd56f3594e5a653cfd127d2167b13119e5c45c3f76b4e3d904a9bc0cbb43c33aa7f23b":0
Paul Bakkerba48cb22009-07-12 11:01:32 +00001607
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001608Test mbedtls_mpi_is_prime #11
1609depends_on:MBEDTLS_GENPRIME
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001610mpi_is_prime:"7a364ab3de755f924642bd5273524234f78395da1ed9098f39af4fe248288b0cb7f1c27214588969479d7dc9f0d327b5544dd4c095aa1fa271df421fe9ee460855cc8423d223e2c85dc793f6babdca7fc804ea1f408f867db053bfd98c45085ea5d805c78d2863bacdfcaf4c6147ebb74a9056045074785714c0b84ed":0
Paul Bakkerba48cb22009-07-12 11:01:32 +00001611
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001612Test mbedtls_mpi_is_prime #12
1613depends_on:MBEDTLS_GENPRIME
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001614mpi_is_prime:"9c3525e8404f89b7d30b3ccfdb0fab17f81adebbac1b6c6bf558a796014fe3b6cd2c4445c0826d7ef5f5d3aff5ac108185675d2159cd275c64812f24da66dbb0147efc6a3d2f8060e8304f48844abc9d33686087ccc11f":0
Paul Bakkerba48cb22009-07-12 11:01:32 +00001615
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001616Test mbedtls_mpi_is_prime #13
1617depends_on:MBEDTLS_GENPRIME
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001618mpi_is_prime:"284139ea19c139ebe09a8111926aaa39a2c2be12ed487a809d3cb5bc55854725b4cdcb5734c58f90b2f60d99cc1950cdbc8d651793e93c9c6f0ead752500a32c56c62082912b66132b2a6aa42ada923e1ad22ceb7ba0123":0
Paul Bakkerba48cb22009-07-12 11:01:32 +00001619
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001620Test mbedtls_mpi_is_prime #14
1621depends_on:MBEDTLS_GENPRIME
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001622mpi_is_prime:"2eede25f74336afd1f51cbc4e809f8bb746ffac49335d129d1ff322ee3498b2b8144f0b136de076db169da4f4436de1f0c715b3d255272b4d77523174081a2fb703f82409185e0ef73e5a8bdf94e5b789fb7bf9be8eec9f":0
Paul Bakkerba48cb22009-07-12 11:01:32 +00001623
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001624Test mbedtls_mpi_is_prime #15
1625depends_on:MBEDTLS_GENPRIME
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001626mpi_is_prime:"7fffffffffffffffffffffffffffffff":0
Paul Bakkerba48cb22009-07-12 11:01:32 +00001627
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001628Test mbedtls_mpi_is_prime #16
1629depends_on:MBEDTLS_GENPRIME
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001630mpi_is_prime:"7fffffff":0
Paul Bakkerba48cb22009-07-12 11:01:32 +00001631
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001632Test mbedtls_mpi_is_prime #17
1633depends_on:MBEDTLS_GENPRIME
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001634mpi_is_prime:"39531fcd":0
Paul Bakkerba48cb22009-07-12 11:01:32 +00001635
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001636Test mbedtls_mpi_is_prime #18
1637depends_on:MBEDTLS_GENPRIME
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001638mpi_is_prime:"ab1cdb3":0
Paul Bakkerba48cb22009-07-12 11:01:32 +00001639
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001640Test mbedtls_mpi_is_prime #19
1641depends_on:MBEDTLS_GENPRIME
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001642mpi_is_prime:"1ef3103":0
Paul Bakkerba48cb22009-07-12 11:01:32 +00001643
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001644Test mbedtls_mpi_is_prime #20
1645depends_on:MBEDTLS_GENPRIME
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001646mpi_is_prime:"2faa127":0
Paul Bakkerba48cb22009-07-12 11:01:32 +00001647
Janos Follath64eca052018-09-05 17:04:49 +01001648Test mbedtls_mpi_is_prime_det (4 non-witnesses)
1649depends_on:MBEDTLS_GENPRIME
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001650mpi_is_prime_det:"043BD64BA10B11DA83FBD296B04BCA9E0552FAF6E09CAC74E2D7E735ED0DB09FC47ED76145644203EE0C826013BC602F560BCDAAED557D04683859A65D659FF828A245A2C5B1AC41E01E4669A525A45E23AF":"040EA852F7935ACCECC0E87B845281F047D10DC9AAFEF990AF9D3D66770DA30B0C5B5E03EEA8C0CB79B936FE0BB8EE5389EC1D34EB16C58AA3F2E11AF084160CDF6400BE1CC179867AB074866952D9F34EE7042D27F960E715A97FCB93F3182247D0A6AE51BD21CC2F6B0651F9E572C5FB86F3137053FA85FD7A51816D69B3A53A5A438C17754836D04E98CA240B901F828332F2D72D88C497DA45F533F99A6E53EDEA6B0424EC8951B048FA9A80134B37D0A67014597934E3CFC52C5A4DD4751ADF8D66FC79E84E2A3148C4B15C17E12CB659390FD275F39A331FFC80EC699BC3F6FAB868E30E9B14575FCDAB6FAED01E00112DD28704177E09C335AD43A696FEA761E8DF3B0663277A5C3637F9060CB5E5654F72E9A6B0F369E660AD4CF7ABF4195493545B367BD55271CD4BB7D9C15D3F508FE8F7409C2126FC8E73B43A67CD4EFB21E9F15DBF040A2A8D5F5ED75CEAC12B595C0051F3EC9D5A58ACE82A9506E64F780E9836728260FFE1BFD73E8A9869E3D46A35A856D3028F7FEAB9F4F1A04449AEDC80017EE1014080D87F0B50C8EF255324CD89F7D039":82:5
Janos Follath64eca052018-09-05 17:04:49 +01001651
1652Test mbedtls_mpi_is_prime_det (39 non-witnesses)
1653depends_on:MBEDTLS_GENPRIME
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001654mpi_is_prime_det:"155102B67930FBE8858DF6C0642D77D419A7B7968E622CC7500F3E3F2C5168368C50E0083187":"119B3E2C721834D83416239B04447AA18AE0163E61DCAE97054563D79E094A6FA4485BD6A0501445BF57FE9C058926CDB862E04CC1A95D79D61D9AB3466857A53E04F8D7470C9C86649B226A13DDC534E18DFD5C22FAEA317CA4D4960F18457FD6D2FFB5F3273F74C89980DC774590D8D30D1159CA81999ED94A042D67DA68C82616AD46C2C88288A8EBD0B37AC7C152D9522CA4544642AD1210F6B642FEBF43563FA872B0DEFAFC69D0B6570E8FEA9570D0AADCFA9B06CC8BFD62CEDC221541210EEEF9762448C6D49F26AA767A4D66CB168589E0201923015314E6CD4A480E5936E7CF145F73A564C5B782635B3AFC3028E2632C5D3458224A7C9E8BA1876E8F690463C878292D3DC011E9640331E7F7621F2B5E0F6713DD8C9D6767521C4BA880DA8D11C67753C8493D2C4C4F1443147550D0B25B7FAD04EAFA9F8AA60974C1365C8A794CFEECEB4279B1150909A97E5A7A10B5D91186CA5B25A612036631FE73529C8CFAE51E76FB704A772DE5320EFC1212E7A399B1FEBF57D014AF9129DFF5D2C5DFBBEEAC55F360CF6D22FA90B8E2E9AD0C71AB6495A9452A58D653B8CC26128C66B43EFBA6E39AEC5717A1A3C2AE1449FCABAFE1180B159DA55190CD81A3D9E8D798647E11B827F0A057D6DA5AAD78AB5112EE65E10E8B8B369BA24E1B8AD2CD8548C497016C07A143DE1232F8059BE303572456FA92E76A0F23D1340629228B7D27C02D3833A72745B91A3DBEB5E081117A9F19597F00E4277B414FAEA8C8CEB895C37F956A5A22F8D7A10ADA50B22BAB312504904511AA0EFDD4D3BF20ECB17E8A684564FFB5BBD5E22C429F9A75A4FB4AE468FE7612ED53C7A11212E7EF3435CC9CA6E7DB167B8CCE2BECF35F89013F8F876223C77FA81570970858663C6E32B91080AA47F9C90177F51E6FD7747B910C9489C7B6ACB070996198AD9A40A69711274159210A9A12DBAAA4FB4632446066AB70D735DC95F7C2BCE517E88C064D728DE82B1B043DF4AEE0EFF5131120A4E5B9B4180EB6F6B8A0D1491ABDA069058A9966B1A517D8E7B4997DC52A1E698FD79E271153DF1913FE6787A5D99DE69F39C3F22D26DC731CFBB33FF5C267D85D7A3DAE8E1C87E1DB2F1236212EF1942EA756967FB3D07D629E59EA4034D9A9B5E270DD4A31C8A3DFDA99C1094B5537132C196DA2AEAF5253A019B9AF25B5DCB0D4DD75C7C9C353DA9DAABFB23959A5455312E7E1C21268C1BC14E83DCFDF50C27FD3E8B4EDC04C5F3CB5FCFFF2B57151E1B1EE1A6456DC006BC43E1158674AA4CF7D146DE4A57103BE43ED130C8007294ED2418C7A2B769A7D20EBB5A8367A77B313F81BB119B9954305FF160FF83EED7F808EE6D340A5CCC000CF81AA497D315D350CCE4E86A31456B8AA85B677491FC662933DFA55EB5BFF64B8D85430D676A85D1CAFAFF383E68C4E6C22A51063739EC03FC58C36C07C44E54828BE2152B2E9AFB0F179B157D09B64C147B524BB5424BB1914419424D9100D06EDCFC718F4DF3D562E9E16C446663F35273CA7BC5426B868A80C8D415C9A12A1619CDB7CDB5BEBC70313150BDF8C3AB26B809FE62D28E798EF1EF98C410A2DA0A9071F82154AC569078B0E647E2C085D1D907E634453442803D0492D3D0C78CACB762020C0E589C8B0981321EA2771305FD0413F3B2963FCE9A232F6641DB7E12ADC009A032063C41756E5E19E5711DE12711F07AFE7545B4D83F3EFD7BFD0435297C89DF3D4AF96EBE2CE8D64B93E36EA5D7E5A0492151D0CAEE7449A7D35E1A3C83E22C3B35162C073CC3B1CF76FBDEE84270721FC042EAAEB7325110181415E2031CFB7462F15111291CDAC0560FF9F4C7341F2FA261B97CEF348D074AA2EB4DB153FE6B1410519DA4213B611999868F3B867A2B6D758D333C4989DE80782683CA26ECDE373C71524F01B76349CE8A07A5EBECBB42259CF970DDA756EC996B189FEA045FEE45F23D476960913106ECA2510B8517AA75D56FA4152B2BDDC212014E5D07FD964D6EE532F0616DF74E104659955132331FABF2D2AD265E71C93C648A956FA0A3DB21FF103D516527F2DA0E870340B61EE8A8ED913B60605EB5A67B834D0FC90564386012585609870FEF6530B3E3C037B55506F0B5694F6B0FC":38:40
Janos Follath64eca052018-09-05 17:04:49 +01001655
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001656Test mbedtls_mpi_gen_prime (Too small)
1657depends_on:MBEDTLS_GENPRIME
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001658mpi_gen_prime:2:0:MBEDTLS_ERR_MPI_BAD_INPUT_DATA
Manuel Pégourié-Gonnard15f58a82014-06-16 17:12:40 +02001659
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001660Test mbedtls_mpi_gen_prime (OK, minimum size)
1661depends_on:MBEDTLS_GENPRIME
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001662mpi_gen_prime:3:0:0
Manuel Pégourié-Gonnard15f58a82014-06-16 17:12:40 +02001663
Jethro Beekman66689272018-02-14 19:24:10 -08001664Test mbedtls_mpi_gen_prime (corner case limb size -1 bits)
1665depends_on:MBEDTLS_GENPRIME
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001666mpi_gen_prime:63:0:0
Jethro Beekman66689272018-02-14 19:24:10 -08001667
1668Test mbedtls_mpi_gen_prime (corner case limb size)
1669depends_on:MBEDTLS_GENPRIME
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001670mpi_gen_prime:64:0:0
Jethro Beekman66689272018-02-14 19:24:10 -08001671
1672Test mbedtls_mpi_gen_prime (corner case limb size +1 bits)
1673depends_on:MBEDTLS_GENPRIME
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001674mpi_gen_prime:65:0:0
Jethro Beekman66689272018-02-14 19:24:10 -08001675
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001676Test mbedtls_mpi_gen_prime (Larger)
1677depends_on:MBEDTLS_GENPRIME
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001678mpi_gen_prime:128:0:0
Manuel Pégourié-Gonnard15f58a82014-06-16 17:12:40 +02001679
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001680Test mbedtls_mpi_gen_prime (Safe)
1681depends_on:MBEDTLS_GENPRIME
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001682mpi_gen_prime:128:MBEDTLS_MPI_GEN_PRIME_FLAG_DH:0
Manuel Pégourié-Gonnard15f58a82014-06-16 17:12:40 +02001683
Janos Follatha3cb7eb2018-08-14 15:31:54 +01001684Test mbedtls_mpi_gen_prime (Safe with lower error rate)
1685depends_on:MBEDTLS_GENPRIME
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001686mpi_gen_prime:128:MBEDTLS_MPI_GEN_PRIME_FLAG_DH | MBEDTLS_MPI_GEN_PRIME_FLAG_LOW_ERR:0
Janos Follatha3cb7eb2018-08-14 15:31:54 +01001687
1688Test mbedtls_mpi_gen_prime standard RSA #1 (lower error rate)
1689depends_on:MBEDTLS_GENPRIME
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001690mpi_gen_prime:1024:MBEDTLS_MPI_GEN_PRIME_FLAG_LOW_ERR:0
Janos Follatha3cb7eb2018-08-14 15:31:54 +01001691
1692Test mbedtls_mpi_gen_prime standard RSA #2 (lower error rate)
1693depends_on:MBEDTLS_GENPRIME
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001694mpi_gen_prime:1536:MBEDTLS_MPI_GEN_PRIME_FLAG_LOW_ERR:0
Janos Follatha3cb7eb2018-08-14 15:31:54 +01001695
Paul Bakker2f5947e2011-05-18 15:47:11 +00001696Test bit getting (Value bit 25)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001697mpi_get_bit:"2faa127":25:1
Paul Bakker2f5947e2011-05-18 15:47:11 +00001698
1699Test bit getting (Larger but same limb)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001700mpi_get_bit:"2faa127":26:0
Paul Bakker2f5947e2011-05-18 15:47:11 +00001701
1702Test bit getting (Larger and non-existing limb)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001703mpi_get_bit:"2faa127":500:0
Paul Bakker2f5947e2011-05-18 15:47:11 +00001704
Gilles Peskine36374882021-06-08 23:01:13 +02001705Test bit getting in 0 (null)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001706mpi_get_bit:"":500:0
Gilles Peskine36374882021-06-08 23:01:13 +02001707
Paul Bakker2f5947e2011-05-18 15:47:11 +00001708Test bit getting (Value bit 24)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001709mpi_get_bit:"2faa127":24:0
Paul Bakker2f5947e2011-05-18 15:47:11 +00001710
1711Test bit getting (Value bit 23)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001712mpi_get_bit:"2faa127":23:1
Paul Bakker2f5947e2011-05-18 15:47:11 +00001713
1714Test bit set (Change existing value with a 1)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001715mpi_set_bit:"2faa127":24:1:"3faa127":0
Paul Bakker2f5947e2011-05-18 15:47:11 +00001716
1717Test bit set (Change existing value with a 0)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001718mpi_set_bit:"2faa127":25:0:"faa127":0
Paul Bakker2f5947e2011-05-18 15:47:11 +00001719
1720Test bit set (Add above existing limbs with a 0)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001721mpi_set_bit:"2faa127":80:0:"2faa127":0
Paul Bakker2f5947e2011-05-18 15:47:11 +00001722
1723Test bit set (Add above existing limbs with a 1)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001724mpi_set_bit:"2faa127":80:1:"100000000000002faa127":0
Paul Bakker2f5947e2011-05-18 15:47:11 +00001725
Gilles Peskine36374882021-06-08 23:01:13 +02001726Test bit set (Add to 0 (null) with a 0)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001727mpi_set_bit:"":65:0:"":0
Gilles Peskine36374882021-06-08 23:01:13 +02001728
1729Test bit set (Add to 0 (null) with a 1)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001730mpi_set_bit:"":65:1:"020000000000000000":0
Gilles Peskine36374882021-06-08 23:01:13 +02001731
Manuel Pégourié-Gonnard9a4a5ac2013-12-04 18:05:29 +01001732Test bit set (Bit index larger than 31 with a 0)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001733mpi_set_bit:"FFFFFFFFFFFFFFFF":32:0:"FFFFFFFEFFFFFFFF":0
Manuel Pégourié-Gonnard9a4a5ac2013-12-04 18:05:29 +01001734
1735Test bit set (Bit index larger than 31 with a 1)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001736mpi_set_bit:"00":32:1:"0100000000":0
Paul Bakkerec5ceb62016-07-14 12:47:07 +01001737
1738Test bit set (Invalid bit value)
Tom Cosgrove1b2947a2022-09-02 10:24:55 +01001739mpi_set_bit:"00":5:2:"00":MBEDTLS_ERR_MPI_BAD_INPUT_DATA
Manuel Pégourié-Gonnard9a4a5ac2013-12-04 18:05:29 +01001740
Gilles Peskine3cb1e292020-11-25 15:37:20 +01001741Fill random: 0 bytes
Gilles Peskine422e8672021-04-02 00:02:27 +02001742mpi_fill_random:0:0:0:0
Gilles Peskine3cb1e292020-11-25 15:37:20 +01001743
1744Fill random: 1 byte, good
Gilles Peskine422e8672021-04-02 00:02:27 +02001745mpi_fill_random:1:1:0:0
Gilles Peskine3cb1e292020-11-25 15:37:20 +01001746
1747Fill random: 2 bytes, good, no leading zero
Gilles Peskine422e8672021-04-02 00:02:27 +02001748mpi_fill_random:2:2:0:0
Gilles Peskine3cb1e292020-11-25 15:37:20 +01001749
1750Fill random: 2 bytes, good, 1 leading zero
Gilles Peskine422e8672021-04-02 00:02:27 +02001751mpi_fill_random:2:256:0:0
Gilles Peskine3cb1e292020-11-25 15:37:20 +01001752
1753Fill random: MAX_SIZE - 7, good
Gilles Peskine422e8672021-04-02 00:02:27 +02001754mpi_fill_random:MBEDTLS_MPI_MAX_SIZE - 7:MBEDTLS_MPI_MAX_SIZE - 7:0:0
Gilles Peskine3cb1e292020-11-25 15:37:20 +01001755
1756Fill random: MAX_SIZE, good
Gilles Peskine422e8672021-04-02 00:02:27 +02001757mpi_fill_random:MBEDTLS_MPI_MAX_SIZE:MBEDTLS_MPI_MAX_SIZE:0:0
1758
1759Fill random: 0 bytes, previously small >0
1760mpi_fill_random:0:0:1:0
1761
1762Fill random: 0 bytes, previously small <0
1763mpi_fill_random:0:0:-1:0
1764
1765Fill random: 0 bytes, previously large >0
1766mpi_fill_random:0:0:65:0
1767
1768Fill random: 0 bytes, previously large <0
1769mpi_fill_random:0:0:-65:0
1770
1771Fill random: 1 byte, previously small >0
1772mpi_fill_random:1:1:1:0
1773
1774Fill random: 1 byte, previously small <0
1775mpi_fill_random:1:1:-1:0
1776
1777Fill random: 1 byte, previously large >0
1778mpi_fill_random:1:1:65:0
1779
1780Fill random: 1 byte, previously large <0
1781mpi_fill_random:1:1:-65:0
1782
1783Fill random: 9 bytes, previously small >0
1784mpi_fill_random:1:1:1:0
1785
1786Fill random: 9 bytes, previously small <0
1787mpi_fill_random:1:1:-1:0
Gilles Peskine3cb1e292020-11-25 15:37:20 +01001788
1789Fill random: 1 byte, RNG failure
Gilles Peskine422e8672021-04-02 00:02:27 +02001790mpi_fill_random:1:0:0:MBEDTLS_ERR_ENTROPY_SOURCE_FAILED
Gilles Peskine3cb1e292020-11-25 15:37:20 +01001791
1792Fill random: 2 bytes, RNG failure after 1 byte
Gilles Peskine422e8672021-04-02 00:02:27 +02001793mpi_fill_random:2:1:0:MBEDTLS_ERR_ENTROPY_SOURCE_FAILED
Gilles Peskine3cb1e292020-11-25 15:37:20 +01001794
1795Fill random: 4 bytes, RNG failure after 3 bytes
Gilles Peskine422e8672021-04-02 00:02:27 +02001796mpi_fill_random:4:3:0:MBEDTLS_ERR_ENTROPY_SOURCE_FAILED
Gilles Peskine3cb1e292020-11-25 15:37:20 +01001797
1798Fill random: 8 bytes, RNG failure after 7 bytes
Gilles Peskine422e8672021-04-02 00:02:27 +02001799mpi_fill_random:8:7:0:MBEDTLS_ERR_ENTROPY_SOURCE_FAILED
Gilles Peskine3cb1e292020-11-25 15:37:20 +01001800
1801Fill random: 16 bytes, RNG failure after 1 bytes
Gilles Peskine422e8672021-04-02 00:02:27 +02001802mpi_fill_random:16:1:0:MBEDTLS_ERR_ENTROPY_SOURCE_FAILED
Gilles Peskine3cb1e292020-11-25 15:37:20 +01001803
1804Fill random: 16 bytes, RNG failure after 8 bytes
Gilles Peskine422e8672021-04-02 00:02:27 +02001805mpi_fill_random:16:8:0:MBEDTLS_ERR_ENTROPY_SOURCE_FAILED
Gilles Peskine3cb1e292020-11-25 15:37:20 +01001806
1807Fill random: 16 bytes, RNG failure after 15 bytes
Gilles Peskine422e8672021-04-02 00:02:27 +02001808mpi_fill_random:16:15:0:MBEDTLS_ERR_ENTROPY_SOURCE_FAILED
Gilles Peskine3cb1e292020-11-25 15:37:20 +01001809
1810Fill random: MAX_SIZE bytes, RNG failure after MAX_SIZE-1 bytes
Gilles Peskine422e8672021-04-02 00:02:27 +02001811mpi_fill_random:MBEDTLS_MPI_MAX_SIZE:MBEDTLS_MPI_MAX_SIZE-1:0:MBEDTLS_ERR_ENTROPY_SOURCE_FAILED
Gilles Peskine3cb1e292020-11-25 15:37:20 +01001812
Gilles Peskine951b5692021-04-13 20:44:04 +02001813MPI random in range: 1..2
1814mpi_random_many:1:"02":1000
1815
1816MPI random in range: 1..3
1817mpi_random_many:1:"03":1000
1818
Gilles Peskine02ac93a2021-03-29 22:02:55 +02001819MPI random in range: 1..4
1820mpi_random_many:1:"04":1000
1821
1822MPI random in range: 1..5
1823mpi_random_many:1:"05":1000
1824
1825MPI random in range: 1..6
1826mpi_random_many:1:"06":1000
1827
1828MPI random in range: 1..7
1829mpi_random_many:1:"07":1000
1830
1831MPI random in range: 1..8
1832mpi_random_many:1:"08":1000
1833
1834MPI random in range: 1..9
1835mpi_random_many:1:"09":1000
1836
1837MPI random in range: 1..10
1838mpi_random_many:1:"0a":1000
1839
1840MPI random in range: 1..11
1841mpi_random_many:1:"0b":1000
1842
1843MPI random in range: 1..12
1844mpi_random_many:1:"0c":1000
1845
1846MPI random in range: 1..255
1847mpi_random_many:1:"ff":100
1848
1849MPI random in range: 1..256
1850mpi_random_many:1:"0100":100
1851
1852MPI random in range: 1..257
1853mpi_random_many:1:"0101":100
1854
1855MPI random in range: 1..272
1856mpi_random_many:1:"0110":100
1857
1858MPI random in range: 1..2^64-1
1859mpi_random_many:1:"ffffffffffffffff":100
1860
1861MPI random in range: 1..2^64
1862mpi_random_many:1:"010000000000000000":100
1863
1864MPI random in range: 1..2^64+1
1865mpi_random_many:1:"010000000000000001":100
1866
1867MPI random in range: 1..2^64+2^63
1868mpi_random_many:1:"018000000000000000":100
1869
1870MPI random in range: 1..2^65-1
1871mpi_random_many:1:"01ffffffffffffffff":100
1872
1873MPI random in range: 1..2^65
1874mpi_random_many:1:"020000000000000000":100
1875
1876MPI random in range: 1..2^65+1
1877mpi_random_many:1:"020000000000000001":100
1878
1879MPI random in range: 1..2^65+2^64
1880mpi_random_many:1:"030000000000000000":100
1881
1882MPI random in range: 1..2^66+2^65
1883mpi_random_many:1:"060000000000000000":100
1884
1885MPI random in range: 1..2^71-1
1886mpi_random_many:1:"7fffffffffffffffff":100
1887
1888MPI random in range: 1..2^71
1889mpi_random_many:1:"800000000000000000":100
1890
1891MPI random in range: 1..2^71+1
1892mpi_random_many:1:"800000000000000001":100
1893
Gilles Peskine9077e432021-06-02 21:22:25 +02001894MPI random in range: 1..2^71+2^70
Gilles Peskine02ac93a2021-03-29 22:02:55 +02001895mpi_random_many:1:"c00000000000000000":100
1896
1897MPI random in range: 1..2^72-1
1898mpi_random_many:1:"ffffffffffffffffff":100
1899
1900MPI random in range: 1..2^72
1901mpi_random_many:1:"01000000000000000000":100
1902
1903MPI random in range: 1..2^72+1
1904mpi_random_many:1:"01000000000000000001":100
1905
Gilles Peskine9077e432021-06-02 21:22:25 +02001906MPI random in range: 1..2^72+2^71
Gilles Peskine02ac93a2021-03-29 22:02:55 +02001907mpi_random_many:1:"01800000000000000000":100
1908
Gilles Peskine951b5692021-04-13 20:44:04 +02001909MPI random in range: 0..1
1910mpi_random_many:0:"04":10000
1911
Gilles Peskine02ac93a2021-03-29 22:02:55 +02001912MPI random in range: 0..4
Gilles Peskine951b5692021-04-13 20:44:04 +02001913mpi_random_many:0:"04":10000
Gilles Peskine02ac93a2021-03-29 22:02:55 +02001914
1915MPI random in range: 2..4
Gilles Peskine951b5692021-04-13 20:44:04 +02001916mpi_random_many:2:"04":10000
Gilles Peskine02ac93a2021-03-29 22:02:55 +02001917
1918MPI random in range: 3..4
Gilles Peskine951b5692021-04-13 20:44:04 +02001919mpi_random_many:3:"04":10000
Gilles Peskine02ac93a2021-03-29 22:02:55 +02001920
Gilles Peskine1a7df4e2021-04-01 15:57:18 +02001921MPI random in range: smaller result
Gilles Peskine422e8672021-04-02 00:02:27 +02001922mpi_random_sizes:1:"aaaaaaaaaaaaaaaabbbbbbbbbbbbbbbb":1:0
Gilles Peskine1a7df4e2021-04-01 15:57:18 +02001923
1924MPI random in range: same size result (32-bit limbs)
Gilles Peskine422e8672021-04-02 00:02:27 +02001925mpi_random_sizes:1:"aaaaaaaaaaaaaaaa":2:0
Gilles Peskine1a7df4e2021-04-01 15:57:18 +02001926
1927MPI random in range: same size result (64-bit limbs)
Gilles Peskine422e8672021-04-02 00:02:27 +02001928mpi_random_sizes:1:"aaaaaaaaaaaaaaaa":1:0
Gilles Peskine1a7df4e2021-04-01 15:57:18 +02001929
1930MPI random in range: larger result
Gilles Peskine422e8672021-04-02 00:02:27 +02001931mpi_random_sizes:1:"aaaaaaaaaaaaaaaa":3:0
Gilles Peskine1a7df4e2021-04-01 15:57:18 +02001932
Gilles Peskine0cb493d2021-04-13 21:32:24 +02001933## The "0 limb in upper bound" tests rely on the fact that
1934## mbedtls_mpi_read_binary() bases the size of the MPI on the size of
1935## the input, without first checking for leading zeros. If this was
1936## not the case, the tests would still pass, but would not exercise
1937## the advertised behavior.
Gilles Peskine1a7df4e2021-04-01 15:57:18 +02001938MPI random in range: leading 0 limb in upper bound #0
Gilles Peskine422e8672021-04-02 00:02:27 +02001939mpi_random_sizes:1:"00aaaaaaaaaaaaaaaa":0:0
Gilles Peskine1a7df4e2021-04-01 15:57:18 +02001940
1941MPI random in range: leading 0 limb in upper bound #1
Gilles Peskine422e8672021-04-02 00:02:27 +02001942mpi_random_sizes:1:"00aaaaaaaaaaaaaaaa":1:0
Gilles Peskine1a7df4e2021-04-01 15:57:18 +02001943
1944MPI random in range: leading 0 limb in upper bound #2
Gilles Peskine422e8672021-04-02 00:02:27 +02001945mpi_random_sizes:1:"00aaaaaaaaaaaaaaaa":2:0
Gilles Peskine1a7df4e2021-04-01 15:57:18 +02001946
1947MPI random in range: leading 0 limb in upper bound #3
Gilles Peskine422e8672021-04-02 00:02:27 +02001948mpi_random_sizes:1:"00aaaaaaaaaaaaaaaa":3:0
Gilles Peskine1a7df4e2021-04-01 15:57:18 +02001949
1950MPI random in range: leading 0 limb in upper bound #4
Gilles Peskine422e8672021-04-02 00:02:27 +02001951mpi_random_sizes:1:"00aaaaaaaaaaaaaaaa":4:0
1952
1953MPI random in range: previously small >0
1954mpi_random_sizes:1:"1234567890":4:1
1955
1956MPI random in range: previously small <0
1957mpi_random_sizes:1:"1234567890":4:-1
1958
1959MPI random in range: previously large >0
1960mpi_random_sizes:1:"1234":4:65
1961
1962MPI random in range: previously large <0
1963mpi_random_sizes:1:"1234":4:-65
Gilles Peskine1a7df4e2021-04-01 15:57:18 +02001964
Gilles Peskine1e918f42021-03-29 22:14:51 +02001965MPI random bad arguments: min < 0
1966mpi_random_fail:-1:"04":MBEDTLS_ERR_MPI_BAD_INPUT_DATA
1967
1968MPI random bad arguments: min = N = 0
1969mpi_random_fail:0:"00":MBEDTLS_ERR_MPI_BAD_INPUT_DATA
1970
1971MPI random bad arguments: min = N = 1
1972mpi_random_fail:1:"01":MBEDTLS_ERR_MPI_BAD_INPUT_DATA
1973
Gilles Peskine0ad640a2021-04-13 20:47:07 +02001974MPI random bad arguments: min > N = 0
1975mpi_random_fail:1:"00":MBEDTLS_ERR_MPI_BAD_INPUT_DATA
1976
1977MPI random bad arguments: min > N = 1
1978mpi_random_fail:2:"01":MBEDTLS_ERR_MPI_BAD_INPUT_DATA
1979
Gilles Peskine0cb493d2021-04-13 21:32:24 +02001980MPI random bad arguments: min > N = 1, 0 limb in upper bound
Gilles Peskine0ad640a2021-04-13 20:47:07 +02001981mpi_random_fail:2:"000000000000000001":MBEDTLS_ERR_MPI_BAD_INPUT_DATA
Paul Bakker367dae42009-06-28 21:50:27 +00001982
Paul Bakker367dae42009-06-28 21:50:27 +00001983MPI Selftest
1984depends_on:MBEDTLS_SELF_TEST
1985mpi_selftest: