Hanno Becker | b48e1aa | 2018-12-18 23:25:01 +0000 | [diff] [blame] | 1 | MPI - Valid parameters |
| 2 | mpi_valid_param: |
| 3 | |
| 4 | MPI - Invalid parameters |
Hanno Becker | afb607b | 2018-12-11 14:27:08 +0000 | [diff] [blame] | 5 | mpi_invalid_param: |
| 6 | |
Manuel Pégourié-Gonnard | 770b5e1 | 2015-04-29 17:02:01 +0200 | [diff] [blame] | 7 | Arguments with no value |
| 8 | mpi_null: |
| 9 | |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 10 | Base test mpi_read_write_string #1 |
Paul Bakker | ba48cb2 | 2009-07-12 11:01:32 +0000 | [diff] [blame] | 11 | mpi_read_write_string:10:"128":10:"128":100:0:0 |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 12 | |
Gilles Peskine | 228b98f | 2021-04-03 18:25:29 +0200 | [diff] [blame] | 13 | Base test mpi_read_write_string #1 (Leading 0) |
| 14 | mpi_read_write_string:10:"0128":10:"128":100:0:0 |
| 15 | |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 16 | Base test mpi_read_write_string #2 |
Paul Bakker | ba48cb2 | 2009-07-12 11:01:32 +0000 | [diff] [blame] | 17 | mpi_read_write_string:10:"128":16:"80":100:0:0 |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 18 | |
Gilles Peskine | 228b98f | 2021-04-03 18:25:29 +0200 | [diff] [blame] | 19 | Base test mpi_read_write_string #3 (Read zero decimal) |
Paul Bakker | ba48cb2 | 2009-07-12 11:01:32 +0000 | [diff] [blame] | 20 | mpi_read_write_string:10:"0":10:"0":100:0:0 |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 21 | |
Gilles Peskine | 228b98f | 2021-04-03 18:25:29 +0200 | [diff] [blame] | 22 | Base test mpi_read_write_string #3 (Read zero hex) |
| 23 | mpi_read_write_string:16:"0":16:"00":100:0:0 |
| 24 | |
| 25 | Base test mpi_read_write_string #3 (Read minus zero decimal) |
| 26 | mpi_read_write_string:10:"-0":10:"0":100:0:0 |
| 27 | |
| 28 | Base test mpi_read_write_string #3 (Read minus zero hex) |
| 29 | mpi_read_write_string:16:"-0":16:"00":100:0:0 |
| 30 | |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 31 | Base test mpi_read_write_string #3 (Negative decimal) |
Paul Bakker | ba48cb2 | 2009-07-12 11:01:32 +0000 | [diff] [blame] | 32 | mpi_read_write_string:10:"-23":10:"-23":100:0:0 |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 33 | |
Gilles Peskine | 228b98f | 2021-04-03 18:25:29 +0200 | [diff] [blame] | 34 | Base test mpi_read_write_string #3 (Negative decimal, leading 0) |
| 35 | mpi_read_write_string:10:"-023":10:"-23":100:0:0 |
| 36 | |
Gilles Peskine | 5a1d0fc | 2021-04-09 15:46:40 +0200 | [diff] [blame] | 37 | Base test mpi_read_write_string #3 (Negative hex -> decimal) |
Paul Bakker | ba48cb2 | 2009-07-12 11:01:32 +0000 | [diff] [blame] | 38 | mpi_read_write_string:16:"-20":10:"-32":100:0:0 |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 39 | |
Gilles Peskine | 228b98f | 2021-04-03 18:25:29 +0200 | [diff] [blame] | 40 | Base test mpi_read_write_string #3 (Negative hex) |
Paul Bakker | ba48cb2 | 2009-07-12 11:01:32 +0000 | [diff] [blame] | 41 | mpi_read_write_string:16:"-23":16:"-23":100:0:0 |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 42 | |
Gilles Peskine | 228b98f | 2021-04-03 18:25:29 +0200 | [diff] [blame] | 43 | Base test mpi_read_write_string #3 (Negative hex, leading 0) |
| 44 | mpi_read_write_string:16:"-023":16:"-23":100:0:0 |
| 45 | |
Janos Follath | 276284f | 2019-03-06 12:29:37 +0000 | [diff] [blame] | 46 | Base test mpi_read_write_string #4 (Buffer just fits) |
| 47 | mpi_read_write_string:16:"-4":4:"-10":4:0:0 |
| 48 | |
Paul Bakker | ba48cb2 | 2009-07-12 11:01:32 +0000 | [diff] [blame] | 49 | Test mpi_read_write_string #1 (Invalid character) |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 50 | mpi_read_write_string:10:"a28":0:"":100:MBEDTLS_ERR_MPI_INVALID_CHARACTER:0 |
Paul Bakker | ba48cb2 | 2009-07-12 11:01:32 +0000 | [diff] [blame] | 51 | |
| 52 | Test mpi_read_write_string #2 (Illegal input radix) |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 53 | mpi_read_write_string:19:"a28":0:"":100:MBEDTLS_ERR_MPI_BAD_INPUT_DATA:0 |
Paul Bakker | ba48cb2 | 2009-07-12 11:01:32 +0000 | [diff] [blame] | 54 | |
| 55 | Test mpi_read_write_string #3 (Buffer just fits) |
| 56 | mpi_read_write_string:16:"-23":16:"-23":4:0:0 |
| 57 | |
| 58 | Test mpi_read_write_string #4 (Buffer too small) |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 59 | mpi_read_write_string:16:"-23":16:"-23":3:0:MBEDTLS_ERR_MPI_BUFFER_TOO_SMALL |
Paul Bakker | ba48cb2 | 2009-07-12 11:01:32 +0000 | [diff] [blame] | 60 | |
| 61 | Test mpi_read_write_string #5 (Illegal output radix) |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 62 | mpi_read_write_string:16:"-23":17:"-23":4:0:MBEDTLS_ERR_MPI_BAD_INPUT_DATA |
Paul Bakker | ba48cb2 | 2009-07-12 11:01:32 +0000 | [diff] [blame] | 63 | |
| 64 | Test mpi_read_write_string #6 (Output radix of 15) |
| 65 | mpi_read_write_string:10:"29":15:"1e":100:0:0 |
| 66 | |
| 67 | Test mpi_read_write_string #7 |
| 68 | mpi_read_write_string:10:"56125680981752282334141896320372489490613963693556392520816017892111350604111697682705498319512049040516698827829292076808006940873974979584527073481012636016353913462376755556720019831187364993587901952757307830896531678727717924":16:"0941379d00fed1491fe15df284dfde4a142f68aa8d412023195cee66883e6290ffe703f4ea5963bf212713cee46b107c09182b5edcd955adac418bf4918e2889af48e1099d513830cec85c26ac1e158b52620e33ba8692f893efbb2f958b4424":200:0:0 |
Paul Bakker | e896fea | 2009-07-06 06:40:23 +0000 | [diff] [blame] | 69 | |
Gilles Peskine | 228b98f | 2021-04-03 18:25:29 +0200 | [diff] [blame] | 70 | Test mpi_read_write_string #8 (Empty MPI hex -> hex) |
Paul Bakker | 6c343d7 | 2014-07-10 14:36:19 +0200 | [diff] [blame] | 71 | mpi_read_write_string:16:"":16:"00":4:0:0 |
| 72 | |
Gilles Peskine | 228b98f | 2021-04-03 18:25:29 +0200 | [diff] [blame] | 73 | Test mpi_read_write_string #9 (Empty MPI hex -> dec) |
Paul Bakker | 6c343d7 | 2014-07-10 14:36:19 +0200 | [diff] [blame] | 74 | mpi_read_write_string:16:"":10:"0":4:0:0 |
| 75 | |
Gilles Peskine | 228b98f | 2021-04-03 18:25:29 +0200 | [diff] [blame] | 76 | Test mpi_read_write_string #8 (Empty MPI dec -> hex) |
| 77 | mpi_read_write_string:10:"":16:"00":4:0:0 |
| 78 | |
| 79 | Test mpi_read_write_string #9 (Empty MPI dec -> dec) |
| 80 | mpi_read_write_string:10:"":10:"0":4:0:0 |
| 81 | |
Andres AG | d1cc7f6 | 2017-01-06 13:17:35 +0000 | [diff] [blame] | 82 | Test mpi_write_string #10 (Negative hex with odd number of digits) |
| 83 | mpi_read_write_string:16:"-1":16:"":3:0:MBEDTLS_ERR_MPI_BUFFER_TOO_SMALL |
| 84 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 85 | Base test mbedtls_mpi_read_binary #1 |
| 86 | mbedtls_mpi_read_binary:"0941379d00fed1491fe15df284dfde4a142f68aa8d412023195cee66883e6290ffe703f4ea5963bf212713cee46b107c09182b5edcd955adac418bf4918e2889af48e1099d513830cec85c26ac1e158b52620e33ba8692f893efbb2f958b4424":10:"56125680981752282334141896320372489490613963693556392520816017892111350604111697682705498319512049040516698827829292076808006940873974979584527073481012636016353913462376755556720019831187364993587901952757307830896531678727717924" |
Paul Bakker | e896fea | 2009-07-06 06:40:23 +0000 | [diff] [blame] | 87 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 88 | Base test mbedtls_mpi_write_binary #1 |
| 89 | mbedtls_mpi_write_binary:10:"56125680981752282334141896320372489490613963693556392520816017892111350604111697682705498319512049040516698827829292076808006940873974979584527073481012636016353913462376755556720019831187364993587901952757307830896531678727717924":"0941379d00fed1491fe15df284dfde4a142f68aa8d412023195cee66883e6290ffe703f4ea5963bf212713cee46b107c09182b5edcd955adac418bf4918e2889af48e1099d513830cec85c26ac1e158b52620e33ba8692f893efbb2f958b4424":200:0 |
Paul Bakker | ba48cb2 | 2009-07-12 11:01:32 +0000 | [diff] [blame] | 90 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 91 | Test mbedtls_mpi_write_binary #1 (Buffer just fits) |
| 92 | mbedtls_mpi_write_binary:16:"123123123123123123123123123":"0123123123123123123123123123":14:0 |
Paul Bakker | ba48cb2 | 2009-07-12 11:01:32 +0000 | [diff] [blame] | 93 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 94 | Test mbedtls_mpi_write_binary #2 (Buffer too small) |
Azim Khan | 46c9b1f | 2017-05-31 20:46:35 +0100 | [diff] [blame] | 95 | mbedtls_mpi_write_binary:16:"123123123123123123123123123":"23123123123123123123123123":13:MBEDTLS_ERR_MPI_BUFFER_TOO_SMALL |
Paul Bakker | e896fea | 2009-07-06 06:40:23 +0000 | [diff] [blame] | 96 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 97 | Base test mbedtls_mpi_read_file #1 |
| 98 | mbedtls_mpi_read_file:10:"data_files/mpi_10":"01f55332c3a48b910f9942f6c914e58bef37a47ee45cb164a5b6b8d1006bf59a059c21449939ebebfdf517d2e1dbac88010d7b1f141e997bd6801ddaec9d05910f4f2de2b2c4d714e2c14a72fc7f17aa428d59c531627f09":0 |
Paul Bakker | ba48cb2 | 2009-07-12 11:01:32 +0000 | [diff] [blame] | 99 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 100 | Test mbedtls_mpi_read_file #1 (Empty file) |
| 101 | mbedtls_mpi_read_file:10:"data_files/hash_file_4":"":MBEDTLS_ERR_MPI_FILE_IO_ERROR |
Paul Bakker | ba48cb2 | 2009-07-12 11:01:32 +0000 | [diff] [blame] | 102 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 103 | Test mbedtls_mpi_read_file #2 (Illegal input) |
| 104 | mbedtls_mpi_read_file:10:"data_files/hash_file_3":"":0 |
Paul Bakker | e896fea | 2009-07-06 06:40:23 +0000 | [diff] [blame] | 105 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 106 | Test mbedtls_mpi_read_file #3 (Input too big) |
| 107 | mbedtls_mpi_read_file:10:"data_files/mpi_too_big":"":MBEDTLS_ERR_MPI_BUFFER_TOO_SMALL |
Paul Bakker | cb37aa5 | 2011-11-30 16:00:20 +0000 | [diff] [blame] | 108 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 109 | Base test mbedtls_mpi_write_file #1 |
| 110 | mbedtls_mpi_write_file:10:"56125680981752282334141896320372489490613963693556392520816017892111350604111697682705498319512049040516698827829292076808006940873974979584527073481012636016353913462376755556720019831187364993587901952757307830896531678727717924":16:"data_files/mpi_write" |
Paul Bakker | e896fea | 2009-07-06 06:40:23 +0000 | [diff] [blame] | 111 | |
Gilles Peskine | bc781ea | 2021-06-08 23:01:13 +0200 | [diff] [blame] | 112 | Test mbedtls_mpi_lsb: 0 (null) |
| 113 | mbedtls_mpi_lsb:16:"":0 |
| 114 | |
| 115 | Test mbedtls_mpi_lsb: 0 (1 limb) |
| 116 | mbedtls_mpi_lsb:16:"0":0 |
| 117 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 118 | Base test mbedtls_mpi_lsb #1 |
| 119 | mbedtls_mpi_lsb:10:"56125680981752282334141896320372489490613963693556392520816017892111350604111697682705498319512049040516698827829292076808006940873974979584527073481012636016353913462376755556720019831187364993587901952757307830896531678727717924":2 |
Paul Bakker | e896fea | 2009-07-06 06:40:23 +0000 | [diff] [blame] | 120 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 121 | Base test mbedtls_mpi_lsb #2 |
| 122 | mbedtls_mpi_lsb:10:"24":3 |
Paul Bakker | e896fea | 2009-07-06 06:40:23 +0000 | [diff] [blame] | 123 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 124 | Base test mbedtls_mpi_lsb #3 |
| 125 | mbedtls_mpi_lsb:16:"24":2 |
Paul Bakker | e896fea | 2009-07-06 06:40:23 +0000 | [diff] [blame] | 126 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 127 | Base test mbedtls_mpi_lsb #4 |
| 128 | mbedtls_mpi_lsb:16:"2000":13 |
Paul Bakker | e896fea | 2009-07-06 06:40:23 +0000 | [diff] [blame] | 129 | |
Manuel Pégourié-Gonnard | c0696c2 | 2015-06-18 16:47:17 +0200 | [diff] [blame] | 130 | Base test mbedtls_mpi_bitlen #1 |
| 131 | mbedtls_mpi_bitlen:10:"56125680981752282334141896320372489490613963693556392520816017892111350604111697682705498319512049040516698827829292076808006940873974979584527073481012636016353913462376755556720019831187364993587901952757307830896531678727717924":764 |
Paul Bakker | e896fea | 2009-07-06 06:40:23 +0000 | [diff] [blame] | 132 | |
Manuel Pégourié-Gonnard | c0696c2 | 2015-06-18 16:47:17 +0200 | [diff] [blame] | 133 | Base test mbedtls_mpi_bitlen #2 |
| 134 | mbedtls_mpi_bitlen:10:"24":5 |
Paul Bakker | e896fea | 2009-07-06 06:40:23 +0000 | [diff] [blame] | 135 | |
Manuel Pégourié-Gonnard | c0696c2 | 2015-06-18 16:47:17 +0200 | [diff] [blame] | 136 | Base test mbedtls_mpi_bitlen #3 |
| 137 | mbedtls_mpi_bitlen:10:"1":1 |
Paul Bakker | e896fea | 2009-07-06 06:40:23 +0000 | [diff] [blame] | 138 | |
Manuel Pégourié-Gonnard | c0696c2 | 2015-06-18 16:47:17 +0200 | [diff] [blame] | 139 | Base test mbedtls_mpi_bitlen #4 |
| 140 | mbedtls_mpi_bitlen:10:"15":4 |
Paul Bakker | e896fea | 2009-07-06 06:40:23 +0000 | [diff] [blame] | 141 | |
Manuel Pégourié-Gonnard | c0696c2 | 2015-06-18 16:47:17 +0200 | [diff] [blame] | 142 | Base test mbedtls_mpi_bitlen #5 |
| 143 | mbedtls_mpi_bitlen:10:"16":5 |
Paul Bakker | e896fea | 2009-07-06 06:40:23 +0000 | [diff] [blame] | 144 | |
Manuel Pégourié-Gonnard | c0696c2 | 2015-06-18 16:47:17 +0200 | [diff] [blame] | 145 | Base test mbedtls_mpi_bitlen #6 |
| 146 | mbedtls_mpi_bitlen:10:"10":4 |
Paul Bakker | e896fea | 2009-07-06 06:40:23 +0000 | [diff] [blame] | 147 | |
Gilles Peskine | bc781ea | 2021-06-08 23:01:13 +0200 | [diff] [blame] | 148 | Base test mbedtls_mpi_bitlen: 0 (null) |
| 149 | mbedtls_mpi_bitlen:10:"":0 |
| 150 | |
Gilles Peskine | aa9d9ac | 2021-06-08 23:00:17 +0200 | [diff] [blame] | 151 | Base test mbedtls_mpi_bitlen: 0 (1 limb) |
Manuel Pégourié-Gonnard | c0696c2 | 2015-06-18 16:47:17 +0200 | [diff] [blame] | 152 | mbedtls_mpi_bitlen:10:"0":0 |
Paul Bakker | e896fea | 2009-07-06 06:40:23 +0000 | [diff] [blame] | 153 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 154 | Base test mbedtls_mpi_cmp_int #1 |
| 155 | mbedtls_mpi_cmp_int:693:693:0 |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 156 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 157 | Base test mbedtls_mpi_cmp_int #2 |
| 158 | mbedtls_mpi_cmp_int:693:692:1 |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 159 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 160 | Base test mbedtls_mpi_cmp_int #3 |
| 161 | mbedtls_mpi_cmp_int:693:694:-1 |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 162 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 163 | Base test mbedtls_mpi_cmp_int (Negative values) #1 |
| 164 | mbedtls_mpi_cmp_int:-2:-2:0 |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 165 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 166 | Base test mbedtls_mpi_cmp_int (Negative values) #2 |
| 167 | mbedtls_mpi_cmp_int:-2:-3:1 |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 168 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 169 | Base test mbedtls_mpi_cmp_int (Negative values) #3 |
| 170 | mbedtls_mpi_cmp_int:-2:-1:-1 |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 171 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 172 | Base test mbedtls_mpi_cmp_mpi #1 |
| 173 | mbedtls_mpi_cmp_mpi:10:"693":10:"693":0 |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 174 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 175 | Base test mbedtls_mpi_cmp_mpi #2 |
| 176 | mbedtls_mpi_cmp_mpi:10:"693":10:"692":1 |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 177 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 178 | Base test mbedtls_mpi_cmp_mpi #3 |
| 179 | mbedtls_mpi_cmp_mpi:10:"693":10:"694":-1 |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 180 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 181 | Base test mbedtls_mpi_cmp_mpi (Negative values) #1 |
| 182 | mbedtls_mpi_cmp_mpi:10:"-2":10:"-2":0 |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 183 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 184 | Base test mbedtls_mpi_cmp_mpi (Negative values) #2 |
| 185 | mbedtls_mpi_cmp_mpi:10:"-2":10:"-3":1 |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 186 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 187 | Base test mbedtls_mpi_cmp_mpi (Negative values) #3 |
| 188 | mbedtls_mpi_cmp_mpi:10:"-2":10:"-1":-1 |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 189 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 190 | Base test mbedtls_mpi_cmp_mpi (Mixed values) #4 |
| 191 | mbedtls_mpi_cmp_mpi:10:"-3":10:"2":-1 |
Paul Bakker | 0c8f73b | 2012-03-22 14:08:57 +0000 | [diff] [blame] | 192 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 193 | Base test mbedtls_mpi_cmp_mpi (Mixed values) #5 |
| 194 | mbedtls_mpi_cmp_mpi:10:"2":10:"-3":1 |
Paul Bakker | 0c8f73b | 2012-03-22 14:08:57 +0000 | [diff] [blame] | 195 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 196 | Base test mbedtls_mpi_cmp_mpi (Mixed values) #6 |
| 197 | mbedtls_mpi_cmp_mpi:10:"-2":10:"31231231289798":-1 |
Paul Bakker | 0c8f73b | 2012-03-22 14:08:57 +0000 | [diff] [blame] | 198 | |
Gilles Peskine | bc781ea | 2021-06-08 23:01:13 +0200 | [diff] [blame] | 199 | Test mbedtls_mpi_cmp_mpi: 0 (null) = 0 (null) |
| 200 | mbedtls_mpi_cmp_mpi:10:"":10:"":0 |
| 201 | |
| 202 | Test mbedtls_mpi_cmp_mpi: 0 (null) = 0 (1 limb) |
| 203 | mbedtls_mpi_cmp_mpi:10:"":10:"0":0 |
| 204 | |
| 205 | Test mbedtls_mpi_cmp_mpi: 0 (1 limb) = 0 (null) |
| 206 | mbedtls_mpi_cmp_mpi:10:"0":10:"":0 |
| 207 | |
| 208 | Test mbedtls_mpi_cmp_mpi: 0 (1 limb) = 0 (1 limb) |
| 209 | mbedtls_mpi_cmp_mpi:10:"0":10:"0":0 |
| 210 | |
| 211 | Test mbedtls_mpi_cmp_mpi: 0 < positive |
| 212 | mbedtls_mpi_cmp_mpi:10:"0":10:"123":-1 |
| 213 | |
| 214 | Test mbedtls_mpi_cmp_mpi: 0 > negative |
| 215 | mbedtls_mpi_cmp_mpi:10:"0":10:"-123":1 |
| 216 | |
| 217 | Test mbedtls_mpi_cmp_mpi: positive > 0 |
| 218 | mbedtls_mpi_cmp_mpi:10:"123":10:"":1 |
| 219 | |
| 220 | Test mbedtls_mpi_cmp_mpi: negative < 0 |
| 221 | mbedtls_mpi_cmp_mpi:10:"-123":10:"":-1 |
| 222 | |
Janos Follath | 867a3ab | 2019-10-11 14:21:53 +0100 | [diff] [blame] | 223 | Base test mbedtls_mpi_lt_mpi_ct #1 |
Janos Follath | 27d221a | 2019-10-14 09:21:49 +0100 | [diff] [blame] | 224 | mbedtls_mpi_lt_mpi_ct:1:"2B5":1:"2B5":0:0 |
Janos Follath | e9ae630 | 2019-09-11 16:07:14 +0100 | [diff] [blame] | 225 | |
Janos Follath | 867a3ab | 2019-10-11 14:21:53 +0100 | [diff] [blame] | 226 | Base test mbedtls_mpi_lt_mpi_ct #2 |
Janos Follath | 27d221a | 2019-10-14 09:21:49 +0100 | [diff] [blame] | 227 | mbedtls_mpi_lt_mpi_ct:1:"2B5":1:"2B4":0:0 |
Janos Follath | e9ae630 | 2019-09-11 16:07:14 +0100 | [diff] [blame] | 228 | |
Janos Follath | 867a3ab | 2019-10-11 14:21:53 +0100 | [diff] [blame] | 229 | Base test mbedtls_mpi_lt_mpi_ct #3 |
Janos Follath | 27d221a | 2019-10-14 09:21:49 +0100 | [diff] [blame] | 230 | mbedtls_mpi_lt_mpi_ct:1:"2B5":1:"2B6":1:0 |
Janos Follath | e9ae630 | 2019-09-11 16:07:14 +0100 | [diff] [blame] | 231 | |
Janos Follath | 867a3ab | 2019-10-11 14:21:53 +0100 | [diff] [blame] | 232 | Base test mbedtls_mpi_lt_mpi_ct (Negative values) #1 |
Janos Follath | 27d221a | 2019-10-14 09:21:49 +0100 | [diff] [blame] | 233 | mbedtls_mpi_lt_mpi_ct:1:"-2":1:"-2":0:0 |
Janos Follath | e9ae630 | 2019-09-11 16:07:14 +0100 | [diff] [blame] | 234 | |
Janos Follath | 867a3ab | 2019-10-11 14:21:53 +0100 | [diff] [blame] | 235 | Base test mbedtls_mpi_lt_mpi_ct (Negative values) #2 |
Janos Follath | 27d221a | 2019-10-14 09:21:49 +0100 | [diff] [blame] | 236 | mbedtls_mpi_lt_mpi_ct:1:"-2":1:"-3":0:0 |
Janos Follath | e9ae630 | 2019-09-11 16:07:14 +0100 | [diff] [blame] | 237 | |
Janos Follath | 867a3ab | 2019-10-11 14:21:53 +0100 | [diff] [blame] | 238 | Base test mbedtls_mpi_lt_mpi_ct (Negative values) #3 |
Janos Follath | 27d221a | 2019-10-14 09:21:49 +0100 | [diff] [blame] | 239 | mbedtls_mpi_lt_mpi_ct:1:"-2":1:"-1":1:0 |
Janos Follath | e9ae630 | 2019-09-11 16:07:14 +0100 | [diff] [blame] | 240 | |
Janos Follath | b2fddfd | 2019-11-05 11:56:07 +0000 | [diff] [blame] | 241 | Base test mbedtls_mpi_lt_mpi_ct (Mixed values) #1 |
Janos Follath | 27d221a | 2019-10-14 09:21:49 +0100 | [diff] [blame] | 242 | mbedtls_mpi_lt_mpi_ct:1:"-3":1:"2":1:0 |
Janos Follath | e9ae630 | 2019-09-11 16:07:14 +0100 | [diff] [blame] | 243 | |
Janos Follath | b2fddfd | 2019-11-05 11:56:07 +0000 | [diff] [blame] | 244 | Base test mbedtls_mpi_lt_mpi_ct (Mixed values) #2 |
Janos Follath | 27d221a | 2019-10-14 09:21:49 +0100 | [diff] [blame] | 245 | mbedtls_mpi_lt_mpi_ct:1:"2":1:"-3":0:0 |
Janos Follath | e9ae630 | 2019-09-11 16:07:14 +0100 | [diff] [blame] | 246 | |
Janos Follath | b2fddfd | 2019-11-05 11:56:07 +0000 | [diff] [blame] | 247 | Base test mbedtls_mpi_lt_mpi_ct (Mixed values) #3 |
Janos Follath | 27d221a | 2019-10-14 09:21:49 +0100 | [diff] [blame] | 248 | mbedtls_mpi_lt_mpi_ct:2:"-2":2:"1C67967269C6":1:0 |
Janos Follath | e9ae630 | 2019-09-11 16:07:14 +0100 | [diff] [blame] | 249 | |
Janos Follath | b2fddfd | 2019-11-05 11:56:07 +0000 | [diff] [blame] | 250 | Base test mbedtls_mpi_lt_mpi_ct (X is longer in storage) |
Janos Follath | 27d221a | 2019-10-14 09:21:49 +0100 | [diff] [blame] | 251 | mbedtls_mpi_lt_mpi_ct:3:"2B5":2:"2B5":0:MBEDTLS_ERR_MPI_BAD_INPUT_DATA |
Janos Follath | e9ae630 | 2019-09-11 16:07:14 +0100 | [diff] [blame] | 252 | |
Janos Follath | b2fddfd | 2019-11-05 11:56:07 +0000 | [diff] [blame] | 253 | Base test mbedtls_mpi_lt_mpi_ct (Y is longer in storage) |
Janos Follath | 27d221a | 2019-10-14 09:21:49 +0100 | [diff] [blame] | 254 | mbedtls_mpi_lt_mpi_ct:3:"2B5":4:"2B5":0:MBEDTLS_ERR_MPI_BAD_INPUT_DATA |
Janos Follath | e9ae630 | 2019-09-11 16:07:14 +0100 | [diff] [blame] | 255 | |
Gilles Peskine | bc781ea | 2021-06-08 23:01:13 +0200 | [diff] [blame] | 256 | Base test mbedtls_mpi_lt_mpi_ct (length=0) |
| 257 | mbedtls_mpi_lt_mpi_ct:0:"":0:"":0:0 |
| 258 | |
Janos Follath | 798e394 | 2019-10-29 15:05:12 +0000 | [diff] [blame] | 259 | Base test mbedtls_mpi_lt_mpi_ct (corner case - 64 bit) #1 |
Janos Follath | 1452862 | 2019-11-05 11:42:20 +0000 | [diff] [blame] | 260 | mbedtls_mpi_lt_mpi_ct:2:"7FFFFFFFFFFFFFFF":2:"FF":0:0 |
Janos Follath | e1bf02a | 2019-10-14 11:33:39 +0100 | [diff] [blame] | 261 | |
Janos Follath | 798e394 | 2019-10-29 15:05:12 +0000 | [diff] [blame] | 262 | Base test mbedtls_mpi_lt_mpi_ct (corner case - 64 bit) #2 |
Janos Follath | 1452862 | 2019-11-05 11:42:20 +0000 | [diff] [blame] | 263 | mbedtls_mpi_lt_mpi_ct:2:"8000000000000000":2:"7FFFFFFFFFFFFFFF":0:0 |
Janos Follath | e1bf02a | 2019-10-14 11:33:39 +0100 | [diff] [blame] | 264 | |
Janos Follath | 798e394 | 2019-10-29 15:05:12 +0000 | [diff] [blame] | 265 | Base test mbedtls_mpi_lt_mpi_ct (corner case - 64 bit) #3 |
Janos Follath | 1452862 | 2019-11-05 11:42:20 +0000 | [diff] [blame] | 266 | mbedtls_mpi_lt_mpi_ct:2:"8000000000000000":2:"1":0:0 |
Janos Follath | e1bf02a | 2019-10-14 11:33:39 +0100 | [diff] [blame] | 267 | |
Janos Follath | 798e394 | 2019-10-29 15:05:12 +0000 | [diff] [blame] | 268 | Base test mbedtls_mpi_lt_mpi_ct (corner case - 64 bit) #4 |
Janos Follath | 1452862 | 2019-11-05 11:42:20 +0000 | [diff] [blame] | 269 | mbedtls_mpi_lt_mpi_ct:2:"8000000000000000":2:"0":0:0 |
Janos Follath | e1bf02a | 2019-10-14 11:33:39 +0100 | [diff] [blame] | 270 | |
Janos Follath | 798e394 | 2019-10-29 15:05:12 +0000 | [diff] [blame] | 271 | Base test mbedtls_mpi_lt_mpi_ct (corner case - 64 bit) #5 |
Janos Follath | 1452862 | 2019-11-05 11:42:20 +0000 | [diff] [blame] | 272 | mbedtls_mpi_lt_mpi_ct:2:"FFFFFFFFFFFFFFFF":2:"FF":0:0 |
Janos Follath | e1bf02a | 2019-10-14 11:33:39 +0100 | [diff] [blame] | 273 | |
Janos Follath | 798e394 | 2019-10-29 15:05:12 +0000 | [diff] [blame] | 274 | Base test mbedtls_mpi_lt_mpi_ct (corner case - 32 bit) #1 |
Janos Follath | 798e394 | 2019-10-29 15:05:12 +0000 | [diff] [blame] | 275 | mbedtls_mpi_lt_mpi_ct:1:"7FFFFFFF":1:"FF":0:0 |
| 276 | |
| 277 | Base test mbedtls_mpi_lt_mpi_ct (corner case - 32 bit) #2 |
Janos Follath | 798e394 | 2019-10-29 15:05:12 +0000 | [diff] [blame] | 278 | mbedtls_mpi_lt_mpi_ct:1:"80000000":1:"7FFFFFFF":0:0 |
| 279 | |
| 280 | Base test mbedtls_mpi_lt_mpi_ct (corner case - 32 bit) #3 |
Janos Follath | 798e394 | 2019-10-29 15:05:12 +0000 | [diff] [blame] | 281 | mbedtls_mpi_lt_mpi_ct:1:"80000000":1:"1":0:0 |
| 282 | |
| 283 | Base test mbedtls_mpi_lt_mpi_ct (corner case - 32 bit) #4 |
Janos Follath | 798e394 | 2019-10-29 15:05:12 +0000 | [diff] [blame] | 284 | mbedtls_mpi_lt_mpi_ct:1:"80000000":1:"0":0:0 |
| 285 | |
| 286 | Base test mbedtls_mpi_lt_mpi_ct (corner case - 32 bit) #5 |
Janos Follath | 798e394 | 2019-10-29 15:05:12 +0000 | [diff] [blame] | 287 | mbedtls_mpi_lt_mpi_ct:1:"FFFFFFFF":1:"FF":0:0 |
| 288 | |
Janos Follath | b2fddfd | 2019-11-05 11:56:07 +0000 | [diff] [blame] | 289 | Multi-limb mbedtls_mpi_lt_mpi_ct (X<Y, zero vs non-zero MS limb) |
Janos Follath | e1bf02a | 2019-10-14 11:33:39 +0100 | [diff] [blame] | 290 | mbedtls_mpi_lt_mpi_ct:2:"0FFFFFFFFFFFFFFFF":2:"1FFFFFFFFFFFFFFFF":1:0 |
| 291 | |
Janos Follath | b2fddfd | 2019-11-05 11:56:07 +0000 | [diff] [blame] | 292 | Multi-limb mbedtls_mpi_lt_mpi_ct (X>Y, equal MS limbs) |
Janos Follath | e1bf02a | 2019-10-14 11:33:39 +0100 | [diff] [blame] | 293 | mbedtls_mpi_lt_mpi_ct:2:"-EEFFFFFFFFFFFFFFF1":2:"-EEFFFFFFFFFFFFFFFF":0:0 |
| 294 | |
Janos Follath | b2fddfd | 2019-11-05 11:56:07 +0000 | [diff] [blame] | 295 | Multi-limb mbedtls_mpi_lt_mpi_ct (X=Y) |
Janos Follath | e1bf02a | 2019-10-14 11:33:39 +0100 | [diff] [blame] | 296 | mbedtls_mpi_lt_mpi_ct:2:"EEFFFFFFFFFFFFFFFF":2:"EEFFFFFFFFFFFFFFFF":0:0 |
| 297 | |
Janos Follath | b2fddfd | 2019-11-05 11:56:07 +0000 | [diff] [blame] | 298 | Multi-limb mbedtls_mpi_lt_mpi_ct (X=-Y) |
Janos Follath | e1bf02a | 2019-10-14 11:33:39 +0100 | [diff] [blame] | 299 | mbedtls_mpi_lt_mpi_ct:2:"-EEFFFFFFFFFFFFFFFF":2:"EEFFFFFFFFFFFFFFFF":1:0 |
| 300 | |
Janos Follath | b159ae8 | 2019-11-05 12:19:14 +0000 | [diff] [blame] | 301 | Multi-limb mbedtls_mpi_lt_mpi_ct (Alternating limbs) #1 |
| 302 | mbedtls_mpi_lt_mpi_ct:2:"11FFFFFFFFFFFFFFFF":2:"FF1111111111111111":1:0 |
| 303 | |
| 304 | Multi-limb mbedtls_mpi_lt_mpi_ct (Alternating limbs) #2 |
| 305 | mbedtls_mpi_lt_mpi_ct:2:"FF1111111111111111":2:"11FFFFFFFFFFFFFFFF":0:0 |
| 306 | |
| 307 | Multi-limb mbedtls_mpi_lt_mpi_ct (Alternating limbs) #3 |
| 308 | mbedtls_mpi_lt_mpi_ct:2:"-11FFFFFFFFFFFFFFFF":2:"-FF1111111111111111":0:0 |
| 309 | |
| 310 | Multi-limb mbedtls_mpi_lt_mpi_ct (Alternating limbs) #4 |
| 311 | mbedtls_mpi_lt_mpi_ct:2:"-FF1111111111111111":2:"-11FFFFFFFFFFFFFFFF":1:0 |
| 312 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 313 | Base test mbedtls_mpi_cmp_abs #1 |
| 314 | mbedtls_mpi_cmp_abs:10:"693":10:"693":0 |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 315 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 316 | Base test mbedtls_mpi_cmp_abs #2 |
| 317 | mbedtls_mpi_cmp_abs:10:"693":10:"692":1 |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 318 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 319 | Base test mbedtls_mpi_cmp_abs #3 |
| 320 | mbedtls_mpi_cmp_abs:10:"693":10:"694":-1 |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 321 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 322 | Base test mbedtls_mpi_cmp_abs (Negative values) #1 |
| 323 | mbedtls_mpi_cmp_abs:10:"-2":10:"-2":0 |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 324 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 325 | Base test mbedtls_mpi_cmp_abs (Negative values) #2 |
| 326 | mbedtls_mpi_cmp_abs:10:"-2":10:"-3":-1 |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 327 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 328 | Base test mbedtls_mpi_cmp_abs (Negative values) #3 |
| 329 | mbedtls_mpi_cmp_abs:10:"-2":10:"-1":1 |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 330 | |
Gilles Peskine | bc781ea | 2021-06-08 23:01:13 +0200 | [diff] [blame] | 331 | Test mbedtls_mpi_cmp_abs: 0 (null) = 0 (null) |
| 332 | mbedtls_mpi_cmp_abs:10:"":10:"":0 |
| 333 | |
| 334 | Test mbedtls_mpi_cmp_abs: 0 (null) = 0 (1 limb) |
| 335 | mbedtls_mpi_cmp_abs:10:"":10:"0":0 |
| 336 | |
| 337 | Test mbedtls_mpi_cmp_abs: 0 (1 limb) = 0 (null) |
| 338 | mbedtls_mpi_cmp_abs:10:"0":10:"":0 |
| 339 | |
Gilles Peskine | aa9d9ac | 2021-06-08 23:00:17 +0200 | [diff] [blame] | 340 | Test mbedtls_mpi_cmp_abs: 0 (1 limb) = 0 (1 limb) |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 341 | mbedtls_mpi_cmp_abs:10:"0":10:"0":0 |
Paul Bakker | ba48cb2 | 2009-07-12 11:01:32 +0000 | [diff] [blame] | 342 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 343 | Base test mbedtls_mpi_cmp_abs (Mix values) #1 |
| 344 | mbedtls_mpi_cmp_abs:10:"-2":10:"2":0 |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 345 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 346 | Base test mbedtls_mpi_cmp_abs (Mix values) #2 |
| 347 | mbedtls_mpi_cmp_abs:10:"2":10:"-3":-1 |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 348 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 349 | Base test mbedtls_mpi_cmp_abs (Mix values) #3 |
| 350 | mbedtls_mpi_cmp_abs:10:"-2":10:"1":1 |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 351 | |
Gilles Peskine | 8e1aa66 | 2021-06-10 15:17:30 +0200 | [diff] [blame] | 352 | Copy large negative to large negative |
| 353 | mbedtls_mpi_copy:"-ca5cadedb01dfaceacc01ade":"-face1e55ca11ab1ecab005e5" |
Gilles Peskine | 8fe3b79 | 2020-01-20 21:01:51 +0100 | [diff] [blame] | 354 | |
Gilles Peskine | 8e1aa66 | 2021-06-10 15:17:30 +0200 | [diff] [blame] | 355 | Copy large negative to large positive |
| 356 | mbedtls_mpi_copy:"-ca5cadedb01dfaceacc01ade":"face1e55ca11ab1ecab005e5" |
Gilles Peskine | 8fe3b79 | 2020-01-20 21:01:51 +0100 | [diff] [blame] | 357 | |
Gilles Peskine | 8e1aa66 | 2021-06-10 15:17:30 +0200 | [diff] [blame] | 358 | Copy large negative to small negative |
| 359 | mbedtls_mpi_copy:"-ca5cadedb01dfaceacc01ade":"-beef" |
Gilles Peskine | 8fe3b79 | 2020-01-20 21:01:51 +0100 | [diff] [blame] | 360 | |
Gilles Peskine | 8e1aa66 | 2021-06-10 15:17:30 +0200 | [diff] [blame] | 361 | Copy large negative to small positive |
| 362 | mbedtls_mpi_copy:"-ca5cadedb01dfaceacc01ade":"beef" |
Gilles Peskine | 8fe3b79 | 2020-01-20 21:01:51 +0100 | [diff] [blame] | 363 | |
Gilles Peskine | 8e1aa66 | 2021-06-10 15:17:30 +0200 | [diff] [blame] | 364 | Copy large negative to zero (1 limb) |
| 365 | mbedtls_mpi_copy:"-ca5cadedb01dfaceacc01ade":"0" |
Gilles Peskine | 8fe3b79 | 2020-01-20 21:01:51 +0100 | [diff] [blame] | 366 | |
Gilles Peskine | 8e1aa66 | 2021-06-10 15:17:30 +0200 | [diff] [blame] | 367 | Copy large negative to zero (null) |
| 368 | mbedtls_mpi_copy:"-ca5cadedb01dfaceacc01ade":"" |
| 369 | |
| 370 | Copy large positive to large negative |
| 371 | mbedtls_mpi_copy:"ca5cadedb01dfaceacc01ade":"-face1e55ca11ab1ecab005e5" |
| 372 | |
| 373 | Copy large positive to large positive |
| 374 | mbedtls_mpi_copy:"ca5cadedb01dfaceacc01ade":"face1e55ca11ab1ecab005e5" |
| 375 | |
| 376 | Copy large positive to small negative |
| 377 | mbedtls_mpi_copy:"ca5cadedb01dfaceacc01ade":"-beef" |
| 378 | |
| 379 | Copy large positive to small positive |
| 380 | mbedtls_mpi_copy:"ca5cadedb01dfaceacc01ade":"beef" |
| 381 | |
| 382 | Copy large positive to zero (1 limb) |
| 383 | mbedtls_mpi_copy:"ca5cadedb01dfaceacc01ade":"0" |
| 384 | |
| 385 | Copy large positive to zero (null) |
| 386 | mbedtls_mpi_copy:"ca5cadedb01dfaceacc01ade":"" |
| 387 | |
| 388 | Copy small negative to large negative |
| 389 | mbedtls_mpi_copy:"-bead":"-face1e55ca11ab1ecab005e5" |
| 390 | |
| 391 | Copy small negative to large positive |
| 392 | mbedtls_mpi_copy:"-bead":"face1e55ca11ab1ecab005e5" |
| 393 | |
| 394 | Copy small negative to small negative |
| 395 | mbedtls_mpi_copy:"-bead":"-beef" |
| 396 | |
| 397 | Copy small negative to small positive |
| 398 | mbedtls_mpi_copy:"-bead":"beef" |
| 399 | |
| 400 | Copy small negative to zero (1 limb) |
| 401 | mbedtls_mpi_copy:"-bead":"0" |
| 402 | |
| 403 | Copy small negative to zero (null) |
| 404 | mbedtls_mpi_copy:"-bead":"" |
| 405 | |
| 406 | Copy small positive to large negative |
| 407 | mbedtls_mpi_copy:"bead":"-face1e55ca11ab1ecab005e5" |
| 408 | |
| 409 | Copy small positive to large positive |
| 410 | mbedtls_mpi_copy:"bead":"face1e55ca11ab1ecab005e5" |
| 411 | |
| 412 | Copy small positive to small negative |
| 413 | mbedtls_mpi_copy:"bead":"-beef" |
| 414 | |
| 415 | Copy small positive to small positive |
| 416 | mbedtls_mpi_copy:"bead":"beef" |
| 417 | |
| 418 | Copy small positive to zero (1 limb) |
| 419 | mbedtls_mpi_copy:"bead":"0" |
| 420 | |
| 421 | Copy small positive to zero (null) |
| 422 | mbedtls_mpi_copy:"bead":"" |
| 423 | |
| 424 | Copy zero (1 limb) to large negative |
| 425 | mbedtls_mpi_copy:"0":"-face1e55ca11ab1ecab005e5" |
| 426 | |
| 427 | Copy zero (1 limb) to large positive |
| 428 | mbedtls_mpi_copy:"0":"face1e55ca11ab1ecab005e5" |
| 429 | |
| 430 | Copy zero (1 limb) to small negative |
| 431 | mbedtls_mpi_copy:"0":"-beef" |
| 432 | |
| 433 | Copy zero (1 limb) to small positive |
| 434 | mbedtls_mpi_copy:"0":"beef" |
| 435 | |
| 436 | Copy zero (1 limb) to zero (1 limb) |
| 437 | mbedtls_mpi_copy:"0":"0" |
| 438 | |
| 439 | Copy zero (1 limb) to zero (null) |
| 440 | mbedtls_mpi_copy:"0":"" |
| 441 | |
| 442 | Copy zero (null) to large negative |
| 443 | mbedtls_mpi_copy:"":"-face1e55ca11ab1ecab005e5" |
| 444 | |
| 445 | Copy zero (null) to large positive |
| 446 | mbedtls_mpi_copy:"":"face1e55ca11ab1ecab005e5" |
| 447 | |
| 448 | Copy zero (null) to small negative |
| 449 | mbedtls_mpi_copy:"":"-beef" |
| 450 | |
| 451 | Copy zero (null) to small positive |
| 452 | mbedtls_mpi_copy:"":"beef" |
| 453 | |
| 454 | Copy zero (null) to zero (1 limb) |
| 455 | mbedtls_mpi_copy:"":"0" |
Gilles Peskine | 8fe3b79 | 2020-01-20 21:01:51 +0100 | [diff] [blame] | 456 | |
| 457 | Copy zero (null) to zero (null) |
Gilles Peskine | 8e1aa66 | 2021-06-10 15:17:30 +0200 | [diff] [blame] | 458 | mbedtls_mpi_copy:"":"" |
Gilles Peskine | 8fe3b79 | 2020-01-20 21:01:51 +0100 | [diff] [blame] | 459 | |
Gilles Peskine | 8e1aa66 | 2021-06-10 15:17:30 +0200 | [diff] [blame] | 460 | Copy self: large negative |
| 461 | mpi_copy_self:"-ca5cadedb01dfaceacc01ade" |
Gilles Peskine | 8fe3b79 | 2020-01-20 21:01:51 +0100 | [diff] [blame] | 462 | |
Gilles Peskine | 8e1aa66 | 2021-06-10 15:17:30 +0200 | [diff] [blame] | 463 | Copy self: large positive |
| 464 | mpi_copy_self:"ca5cadedb01dfaceacc01ade" |
Gilles Peskine | 8fe3b79 | 2020-01-20 21:01:51 +0100 | [diff] [blame] | 465 | |
Gilles Peskine | 8e1aa66 | 2021-06-10 15:17:30 +0200 | [diff] [blame] | 466 | Copy self: small negative |
| 467 | mpi_copy_self:"-bead" |
Gilles Peskine | 8fe3b79 | 2020-01-20 21:01:51 +0100 | [diff] [blame] | 468 | |
Gilles Peskine | 8e1aa66 | 2021-06-10 15:17:30 +0200 | [diff] [blame] | 469 | Copy self: small positive |
| 470 | mpi_copy_self:"bead" |
Paul Bakker | e896fea | 2009-07-06 06:40:23 +0000 | [diff] [blame] | 471 | |
Gilles Peskine | 8fe3b79 | 2020-01-20 21:01:51 +0100 | [diff] [blame] | 472 | Copy self: zero (1 limb) |
Gilles Peskine | 8e1aa66 | 2021-06-10 15:17:30 +0200 | [diff] [blame] | 473 | mpi_copy_self:"0" |
| 474 | |
| 475 | Copy self: zero (null) |
| 476 | mpi_copy_self:"" |
Gilles Peskine | 8fe3b79 | 2020-01-20 21:01:51 +0100 | [diff] [blame] | 477 | |
Gilles Peskine | 1e91426 | 2021-06-10 22:29:57 +0200 | [diff] [blame] | 478 | Swap large negative with large negative |
| 479 | mbedtls_mpi_swap:"-ca5cadedb01dfaceacc01ade":"-face1e55ca11ab1ecab005e5" |
Gilles Peskine | 8fe3b79 | 2020-01-20 21:01:51 +0100 | [diff] [blame] | 480 | |
Gilles Peskine | 1e91426 | 2021-06-10 22:29:57 +0200 | [diff] [blame] | 481 | Swap large negative with large positive |
| 482 | mbedtls_mpi_swap:"-ca5cadedb01dfaceacc01ade":"face1e55ca11ab1ecab005e5" |
Gilles Peskine | 8fe3b79 | 2020-01-20 21:01:51 +0100 | [diff] [blame] | 483 | |
Gilles Peskine | 1e91426 | 2021-06-10 22:29:57 +0200 | [diff] [blame] | 484 | Swap large negative with small negative |
| 485 | mbedtls_mpi_swap:"-ca5cadedb01dfaceacc01ade":"-beef" |
Gilles Peskine | 8fe3b79 | 2020-01-20 21:01:51 +0100 | [diff] [blame] | 486 | |
Gilles Peskine | 1e91426 | 2021-06-10 22:29:57 +0200 | [diff] [blame] | 487 | Swap large negative with small positive |
| 488 | mbedtls_mpi_swap:"-ca5cadedb01dfaceacc01ade":"beef" |
Gilles Peskine | 8fe3b79 | 2020-01-20 21:01:51 +0100 | [diff] [blame] | 489 | |
Gilles Peskine | 1e91426 | 2021-06-10 22:29:57 +0200 | [diff] [blame] | 490 | Swap large negative with zero (1 limb) |
| 491 | mbedtls_mpi_swap:"-ca5cadedb01dfaceacc01ade":"0" |
Gilles Peskine | 8fe3b79 | 2020-01-20 21:01:51 +0100 | [diff] [blame] | 492 | |
Gilles Peskine | 1e91426 | 2021-06-10 22:29:57 +0200 | [diff] [blame] | 493 | Swap large negative with zero (null) |
| 494 | mbedtls_mpi_swap:"-ca5cadedb01dfaceacc01ade":"" |
| 495 | |
| 496 | Swap large positive with large negative |
| 497 | mbedtls_mpi_swap:"ca5cadedb01dfaceacc01ade":"-face1e55ca11ab1ecab005e5" |
| 498 | |
| 499 | Swap large positive with large positive |
| 500 | mbedtls_mpi_swap:"ca5cadedb01dfaceacc01ade":"face1e55ca11ab1ecab005e5" |
| 501 | |
| 502 | Swap large positive with small negative |
| 503 | mbedtls_mpi_swap:"ca5cadedb01dfaceacc01ade":"-beef" |
| 504 | |
| 505 | Swap large positive with small positive |
| 506 | mbedtls_mpi_swap:"ca5cadedb01dfaceacc01ade":"beef" |
| 507 | |
| 508 | Swap large positive with zero (1 limb) |
| 509 | mbedtls_mpi_swap:"ca5cadedb01dfaceacc01ade":"0" |
| 510 | |
| 511 | Swap large positive with zero (null) |
| 512 | mbedtls_mpi_swap:"ca5cadedb01dfaceacc01ade":"" |
| 513 | |
| 514 | Swap small negative with large negative |
| 515 | mbedtls_mpi_swap:"-bead":"-face1e55ca11ab1ecab005e5" |
| 516 | |
| 517 | Swap small negative with large positive |
| 518 | mbedtls_mpi_swap:"-bead":"face1e55ca11ab1ecab005e5" |
| 519 | |
| 520 | Swap small negative with small negative |
| 521 | mbedtls_mpi_swap:"-bead":"-beef" |
| 522 | |
| 523 | Swap small negative with small positive |
| 524 | mbedtls_mpi_swap:"-bead":"beef" |
| 525 | |
| 526 | Swap small negative with zero (1 limb) |
| 527 | mbedtls_mpi_swap:"-bead":"0" |
| 528 | |
| 529 | Swap small negative with zero (null) |
| 530 | mbedtls_mpi_swap:"-bead":"" |
| 531 | |
| 532 | Swap small positive with large negative |
| 533 | mbedtls_mpi_swap:"bead":"-face1e55ca11ab1ecab005e5" |
| 534 | |
| 535 | Swap small positive with large positive |
| 536 | mbedtls_mpi_swap:"bead":"face1e55ca11ab1ecab005e5" |
| 537 | |
| 538 | Swap small positive with small negative |
| 539 | mbedtls_mpi_swap:"bead":"-beef" |
| 540 | |
| 541 | Swap small positive with small positive |
| 542 | mbedtls_mpi_swap:"bead":"beef" |
| 543 | |
| 544 | Swap small positive with zero (1 limb) |
| 545 | mbedtls_mpi_swap:"bead":"0" |
| 546 | |
| 547 | Swap small positive with zero (null) |
| 548 | mbedtls_mpi_swap:"bead":"" |
| 549 | |
| 550 | Swap zero (1 limb) with large negative |
| 551 | mbedtls_mpi_swap:"0":"-face1e55ca11ab1ecab005e5" |
| 552 | |
| 553 | Swap zero (1 limb) with large positive |
| 554 | mbedtls_mpi_swap:"0":"face1e55ca11ab1ecab005e5" |
| 555 | |
| 556 | Swap zero (1 limb) with small negative |
| 557 | mbedtls_mpi_swap:"0":"-beef" |
| 558 | |
| 559 | Swap zero (1 limb) with small positive |
| 560 | mbedtls_mpi_swap:"0":"beef" |
| 561 | |
| 562 | Swap zero (1 limb) with zero (1 limb) |
| 563 | mbedtls_mpi_swap:"0":"0" |
| 564 | |
| 565 | Swap zero (1 limb) with zero (null) |
| 566 | mbedtls_mpi_swap:"0":"" |
| 567 | |
| 568 | Swap zero (null) with large negative |
| 569 | mbedtls_mpi_swap:"":"-face1e55ca11ab1ecab005e5" |
| 570 | |
| 571 | Swap zero (null) with large positive |
| 572 | mbedtls_mpi_swap:"":"face1e55ca11ab1ecab005e5" |
| 573 | |
| 574 | Swap zero (null) with small negative |
| 575 | mbedtls_mpi_swap:"":"-beef" |
| 576 | |
| 577 | Swap zero (null) with small positive |
| 578 | mbedtls_mpi_swap:"":"beef" |
| 579 | |
| 580 | Swap zero (null) with zero (1 limb) |
| 581 | mbedtls_mpi_swap:"":"0" |
Gilles Peskine | 8fe3b79 | 2020-01-20 21:01:51 +0100 | [diff] [blame] | 582 | |
| 583 | Swap zero (null) with zero (null) |
Gilles Peskine | 1e91426 | 2021-06-10 22:29:57 +0200 | [diff] [blame] | 584 | mbedtls_mpi_swap:"":"" |
Gilles Peskine | 8fe3b79 | 2020-01-20 21:01:51 +0100 | [diff] [blame] | 585 | |
Gilles Peskine | 1e91426 | 2021-06-10 22:29:57 +0200 | [diff] [blame] | 586 | Swap self: large negative |
| 587 | mpi_swap_self:"-ca5cadedb01dfaceacc01ade" |
Gilles Peskine | 8fe3b79 | 2020-01-20 21:01:51 +0100 | [diff] [blame] | 588 | |
Gilles Peskine | 1e91426 | 2021-06-10 22:29:57 +0200 | [diff] [blame] | 589 | Swap self: large positive |
| 590 | mpi_swap_self:"ca5cadedb01dfaceacc01ade" |
Gilles Peskine | 8fe3b79 | 2020-01-20 21:01:51 +0100 | [diff] [blame] | 591 | |
Gilles Peskine | 1e91426 | 2021-06-10 22:29:57 +0200 | [diff] [blame] | 592 | Swap self: small negative |
| 593 | mpi_swap_self:"-bead" |
Gilles Peskine | 8fe3b79 | 2020-01-20 21:01:51 +0100 | [diff] [blame] | 594 | |
Gilles Peskine | 1e91426 | 2021-06-10 22:29:57 +0200 | [diff] [blame] | 595 | Swap self: small positive |
| 596 | mpi_swap_self:"bead" |
Gilles Peskine | 8fe3b79 | 2020-01-20 21:01:51 +0100 | [diff] [blame] | 597 | |
Gilles Peskine | 1e91426 | 2021-06-10 22:29:57 +0200 | [diff] [blame] | 598 | Swap self: zero (1 limb) |
| 599 | mpi_swap_self:"0" |
Gilles Peskine | 8fe3b79 | 2020-01-20 21:01:51 +0100 | [diff] [blame] | 600 | |
Gilles Peskine | 1e91426 | 2021-06-10 22:29:57 +0200 | [diff] [blame] | 601 | Swap self: zero (null) |
Gilles Peskine | 8fe3b79 | 2020-01-20 21:01:51 +0100 | [diff] [blame] | 602 | mpi_swap_self:"" |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 603 | |
Gilles Peskine | bc781ea | 2021-06-08 23:01:13 +0200 | [diff] [blame] | 604 | Shrink 0 limbs in a buffer of size 0 to 0 |
| 605 | mbedtls_mpi_shrink:0:0:0:0 |
| 606 | |
Gilles Peskine | 8ece857 | 2020-02-03 16:18:30 +0100 | [diff] [blame] | 607 | Shrink 2 limbs in a buffer of size 2 to 4 |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 608 | mbedtls_mpi_shrink:2:2:4:4 |
Manuel Pégourié-Gonnard | 5868163 | 2013-11-21 10:39:37 +0100 | [diff] [blame] | 609 | |
Gilles Peskine | 8ece857 | 2020-02-03 16:18:30 +0100 | [diff] [blame] | 610 | Shrink 2 limbs in a buffer of size 4 to 4 |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 611 | mbedtls_mpi_shrink:4:2:4:4 |
Manuel Pégourié-Gonnard | 5868163 | 2013-11-21 10:39:37 +0100 | [diff] [blame] | 612 | |
Gilles Peskine | 8ece857 | 2020-02-03 16:18:30 +0100 | [diff] [blame] | 613 | Shrink 2 limbs in a buffer of size 8 to 4 |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 614 | mbedtls_mpi_shrink:8:2:4:4 |
Manuel Pégourié-Gonnard | 5868163 | 2013-11-21 10:39:37 +0100 | [diff] [blame] | 615 | |
Gilles Peskine | 8ece857 | 2020-02-03 16:18:30 +0100 | [diff] [blame] | 616 | Shrink 4 limbs in a buffer of size 8 to 4 |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 617 | mbedtls_mpi_shrink:8:4:4:4 |
Manuel Pégourié-Gonnard | 5868163 | 2013-11-21 10:39:37 +0100 | [diff] [blame] | 618 | |
Gilles Peskine | 8ece857 | 2020-02-03 16:18:30 +0100 | [diff] [blame] | 619 | Shrink 6 limbs in a buffer of size 8 to 4 yielding 6 |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 620 | mbedtls_mpi_shrink:8:6:4:6 |
Manuel Pégourié-Gonnard | 5868163 | 2013-11-21 10:39:37 +0100 | [diff] [blame] | 621 | |
Gilles Peskine | 8ece857 | 2020-02-03 16:18:30 +0100 | [diff] [blame] | 622 | Shrink 2 limbs in a buffer of size 4 to 0 yielding 2 |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 623 | mbedtls_mpi_shrink:4:2:0:2 |
Manuel Pégourié-Gonnard | 5868163 | 2013-11-21 10:39:37 +0100 | [diff] [blame] | 624 | |
Gilles Peskine | 8ece857 | 2020-02-03 16:18:30 +0100 | [diff] [blame] | 625 | Shrink 1 limbs in a buffer of size 4 to 0 yielding 1 |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 626 | mbedtls_mpi_shrink:4:1:0:1 |
Manuel Pégourié-Gonnard | 5868163 | 2013-11-21 10:39:37 +0100 | [diff] [blame] | 627 | |
Gilles Peskine | 8ece857 | 2020-02-03 16:18:30 +0100 | [diff] [blame] | 628 | Shrink 0 limbs in a buffer of size 4 to 0 yielding 1 |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 629 | mbedtls_mpi_shrink:4:0:0:1 |
Manuel Pégourié-Gonnard | 5868163 | 2013-11-21 10:39:37 +0100 | [diff] [blame] | 630 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 631 | Base test mbedtls_mpi_add_abs #1 |
| 632 | mbedtls_mpi_add_abs:10:"12345678":10:"642531":10:"12988209" |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 633 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 634 | Base test mbedtls_mpi_add_abs #2 |
| 635 | mbedtls_mpi_add_abs:10:"-12345678":10:"642531":10:"12988209" |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 636 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 637 | Base test mbedtls_mpi_add_abs #3 |
| 638 | mbedtls_mpi_add_abs:10:"12345678":10:"-642531":10:"12988209" |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 639 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 640 | Base test mbedtls_mpi_add_abs #4 |
| 641 | mbedtls_mpi_add_abs:10:"-12345678":10:"-642531":10:"12988209" |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 642 | |
Gilles Peskine | bc781ea | 2021-06-08 23:01:13 +0200 | [diff] [blame] | 643 | Test mbedtls_mpi_add_abs: 0 + 0 |
| 644 | mbedtls_mpi_add_abs:16:"":16:"":16:"" |
| 645 | |
| 646 | Test mbedtls_mpi_add_abs: 0 + 1 |
| 647 | mbedtls_mpi_add_abs:16:"":16:"01":16:"01" |
| 648 | |
| 649 | Test mbedtls_mpi_add_abs: 1 + 0 |
| 650 | mbedtls_mpi_add_abs:16:"01":16:"":16:"01" |
| 651 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 652 | Test mbedtls_mpi_add_abs #1 |
| 653 | mbedtls_mpi_add_abs:10:"-643808006803554439230129854961492699151386107534013432918073439524138264842370630061369715394739134090922937332590384720397133335969549256322620979036686633213903952966175107096769180017646161851573147596390153":10:"56125680981752282333498088313568935051383833838594899821664631784577337171193624243181360054669678410455329112434552942717084003541384594864129940145043086760031292483340068923506115878221189886491132772739661669044958531131327771":10:"56125680981752282334141896320372489490613963693556392520816017892111350604111697682705498319512049040516698827829292076808006940873974979584527073481012636016353913462376755556720019831187364993587901952757307830896531678727717924" |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 654 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 655 | Regression mbedtls_mpi_add_abs (add small to very large MPI with carry rollover) |
| 656 | mbedtls_mpi_add_abs:16:"FFFFFFFFFFFFFFFFFFFFFFFFFFFFF8":16:"08":16:"1000000000000000000000000000000" |
Paul Bakker | 17a9790 | 2012-09-17 08:44:35 +0000 | [diff] [blame] | 657 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 658 | Regression mbedtls_mpi_add_abs (add small to very large MPI with carry rollover) |
| 659 | mbedtls_mpi_add_abs:16:"08":16:"FFFFFFFFFFFFFFFFFFFFFFFFFFFFF8":16:"1000000000000000000000000000000" |
Paul Bakker | 17a9790 | 2012-09-17 08:44:35 +0000 | [diff] [blame] | 660 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 661 | Base test mbedtls_mpi_add_mpi #1 |
| 662 | mbedtls_mpi_add_mpi:10:"12345678":10:"642531":10:"12988209" |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 663 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 664 | Base test mbedtls_mpi_add_mpi #2 |
| 665 | mbedtls_mpi_add_mpi:10:"-12345678":10:"642531":10:"-11703147" |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 666 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 667 | Base test mbedtls_mpi_add_mpi #3 |
| 668 | mbedtls_mpi_add_mpi:10:"12345678":10:"-642531":10:"11703147" |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 669 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 670 | Base test mbedtls_mpi_add_mpi #4 |
| 671 | mbedtls_mpi_add_mpi:10:"-12345678":10:"-642531":10:"-12988209" |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 672 | |
Gilles Peskine | bc781ea | 2021-06-08 23:01:13 +0200 | [diff] [blame] | 673 | Test mbedtls_mpi_add_mpi: 0 + 0 |
| 674 | mbedtls_mpi_add_mpi:16:"":16:"":16:"" |
| 675 | |
| 676 | Test mbedtls_mpi_add_mpi: 0 + 1 |
| 677 | mbedtls_mpi_add_mpi:16:"":16:"01":16:"01" |
| 678 | |
| 679 | Test mbedtls_mpi_add_mpi: 1 + 0 |
| 680 | mbedtls_mpi_add_mpi:16:"01":16:"":16:"01" |
| 681 | |
| 682 | Test mbedtls_mpi_add_mpi: 0 + -1 |
| 683 | mbedtls_mpi_add_mpi:16:"":16:"-01":16:"-01" |
| 684 | |
| 685 | Test mbedtls_mpi_add_mpi: -1 + 0 |
| 686 | mbedtls_mpi_add_mpi:16:"-01":16:"":16:"-01" |
| 687 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 688 | Test mbedtls_mpi_add_mpi #1 |
| 689 | mbedtls_mpi_add_mpi:10:"203956878356401977405765866929034577280193993314348263094772646453283062722701277632936616063144088173312372882677123879538709400158306567338328279154499698366071906766440037074217117805690872792848149112022286332144876183376326512083574821647933992961249917319836219304274280243803104015000563790123":10:"531872289054204184185084734375133399408303613982130856645299464930952178606045848877129147820387996428175564228204785846141207532462936339834139412401975338705794646595487324365194792822189473092273993580587964571659678084484152603881094176995594813302284232006001752128168901293560051833646881436219":10:"735829167410606161590850601304167976688497607296479119740072111384235241328747126510065763883532084601487937110881909725679916932621242907172467691556475037071866553361927361439411910627880345885122142692610250903804554267860479115964668998643528806263534149325837971432443181537363155848647445226342" |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 690 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 691 | Test mbedtls_mpi_add_mpi #2 |
| 692 | mbedtls_mpi_add_mpi:10:"643808006803554439230129854961492699151386107534013432918073439524138264842370630061369715394739134090922937332590384720397133335969549256322620979036686633213903952966175107096769180017646161851573147596390153":10:"56125680981752282333498088313568935051383833838594899821664631784577337171193624243181360054669678410455329112434552942717084003541384594864129940145043086760031292483340068923506115878221189886491132772739661669044958531131327771":10:"56125680981752282334141896320372489490613963693556392520816017892111350604111697682705498319512049040516698827829292076808006940873974979584527073481012636016353913462376755556720019831187364993587901952757307830896531678727717924" |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 693 | |
Janos Follath | 044a86b | 2015-10-25 10:58:03 +0100 | [diff] [blame] | 694 | Base test mbedtls_mpi_add_mpi inplace #1 |
| 695 | mbedtls_mpi_add_mpi_inplace:10:"12345678":10:"24691356" |
| 696 | |
Darryl Green | 11999bb | 2018-03-13 15:22:58 +0000 | [diff] [blame] | 697 | Test mbedtls_mpi_add_mpi inplace #2 |
Janos Follath | 044a86b | 2015-10-25 10:58:03 +0100 | [diff] [blame] | 698 | mbedtls_mpi_add_mpi_inplace:10:"643808006803554439230129854961492699151386107534013432918073439524138264842370630061369715394739134090922937332590384720397133335969549256322620979036686633213903952966175107096769180017646161851573147596390153":10:"1287616013607108878460259709922985398302772215068026865836146879048276529684741260122739430789478268181845874665180769440794266671939098512645241958073373266427807905932350214193538360035292323703146295192780306" |
| 699 | |
Darryl Green | 11999bb | 2018-03-13 15:22:58 +0000 | [diff] [blame] | 700 | Test mbedtls_mpi_add_mpi inplace #3 |
Janos Follath | 6c92268 | 2015-10-30 17:43:11 +0100 | [diff] [blame] | 701 | mbedtls_mpi_add_mpi_inplace:16:"ffffffffffffffffffffffffffffffff":16:"01fffffffffffffffffffffffffffffffe" |
| 702 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 703 | Test mbedtls_mpi_add_int #1 |
| 704 | mbedtls_mpi_add_int:10:"2039568783564019774057658669290345772801939933143482630947726464532830627227012776329":9871232:10:"2039568783564019774057658669290345772801939933143482630947726464532830627227022647561" |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 705 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 706 | Test mbedtls_mpi_add_int #2 |
| 707 | mbedtls_mpi_add_int:10:"2039568783564019774057658669290345772801939933143482630947726464532830627227012776329":-9871232:10:"2039568783564019774057658669290345772801939933143482630947726464532830627227002905097" |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 708 | |
Gilles Peskine | bc781ea | 2021-06-08 23:01:13 +0200 | [diff] [blame] | 709 | Test mbedtls_mpi_add_int: 0 (null) + 0 |
| 710 | mbedtls_mpi_add_int:16:"":0:16:"" |
| 711 | |
| 712 | Test mbedtls_mpi_add_int: 0 (null) + 1 |
| 713 | mbedtls_mpi_add_int:16:"":1:16:"1" |
| 714 | |
Gilles Peskine | 9a3cf31 | 2021-01-27 22:24:30 +0100 | [diff] [blame] | 715 | Base test mbedtls_mpi_sub_abs #1 (|B| > |A|) |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 716 | mbedtls_mpi_sub_abs:10:"5":10:"7":10:"0":MBEDTLS_ERR_MPI_NEGATIVE_VALUE |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 717 | |
Gilles Peskine | 9a3cf31 | 2021-01-27 22:24:30 +0100 | [diff] [blame] | 718 | Base test mbedtls_mpi_sub_abs #2 (|B| > |A|) |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 719 | mbedtls_mpi_sub_abs:10:"-5":10:"-7":10:"0":MBEDTLS_ERR_MPI_NEGATIVE_VALUE |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 720 | |
Gilles Peskine | 9a3cf31 | 2021-01-27 22:24:30 +0100 | [diff] [blame] | 721 | Base test mbedtls_mpi_sub_abs #3 (|B| > |A|) |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 722 | mbedtls_mpi_sub_abs:10:"-5":10:"7":10:"0":MBEDTLS_ERR_MPI_NEGATIVE_VALUE |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 723 | |
Gilles Peskine | 9a3cf31 | 2021-01-27 22:24:30 +0100 | [diff] [blame] | 724 | Base test mbedtls_mpi_sub_abs #4 (|B| > |A|) |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 725 | mbedtls_mpi_sub_abs:10:"5":10:"-7":10:"0":MBEDTLS_ERR_MPI_NEGATIVE_VALUE |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 726 | |
Gilles Peskine | 9a3cf31 | 2021-01-27 22:24:30 +0100 | [diff] [blame] | 727 | Base test mbedtls_mpi_sub_abs #1 (|B| >> |A| with more limbs) |
| 728 | mbedtls_mpi_sub_abs:10:"5":16:"123456789abcdef01":10:"0":MBEDTLS_ERR_MPI_NEGATIVE_VALUE |
| 729 | |
| 730 | Base test mbedtls_mpi_sub_abs #2 (|B| >> |A| with more limbs) |
| 731 | mbedtls_mpi_sub_abs:10:"-5":16:"-123456789abcdef01":10:"0":MBEDTLS_ERR_MPI_NEGATIVE_VALUE |
| 732 | |
| 733 | Base test mbedtls_mpi_sub_abs #3 (|B| >> |A| with more limbs) |
| 734 | mbedtls_mpi_sub_abs:10:"-5":16:"123456789abcdef01":10:"0":MBEDTLS_ERR_MPI_NEGATIVE_VALUE |
| 735 | |
| 736 | Base test mbedtls_mpi_sub_abs #4 (|B| >> |A| with more limbs) |
| 737 | mbedtls_mpi_sub_abs:10:"5":16:"-123456789abcdef01":10:"0":MBEDTLS_ERR_MPI_NEGATIVE_VALUE |
| 738 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 739 | Base test mbedtls_mpi_sub_abs #1 |
| 740 | mbedtls_mpi_sub_abs:10:"7":10:"5":10:"2":0 |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 741 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 742 | Base test mbedtls_mpi_sub_abs #2 |
| 743 | mbedtls_mpi_sub_abs:10:"-7":10:"-5":10:"2":0 |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 744 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 745 | Base test mbedtls_mpi_sub_abs #3 |
| 746 | mbedtls_mpi_sub_abs:10:"-7":10:"5":10:"2":0 |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 747 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 748 | Base test mbedtls_mpi_sub_abs #4 |
| 749 | mbedtls_mpi_sub_abs:10:"7":10:"-5":10:"2":0 |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 750 | |
Gilles Peskine | bc781ea | 2021-06-08 23:01:13 +0200 | [diff] [blame] | 751 | Test mbedtls_mpi_sub_abs: 0 (null) - 0 (null) |
| 752 | mbedtls_mpi_sub_abs:16:"":16:"":16:"":0 |
| 753 | |
| 754 | Test mbedtls_mpi_sub_abs: 0 (null) - 0 (1 limb) |
| 755 | mbedtls_mpi_sub_abs:16:"":16:"00":16:"":0 |
| 756 | |
| 757 | Test mbedtls_mpi_sub_abs: 0 (1 limb) - 0 (null) |
| 758 | mbedtls_mpi_sub_abs:16:"00":16:"":16:"":0 |
| 759 | |
| 760 | Test mbedtls_mpi_sub_abs: 0 (1 limb) - 0 (1 limb) |
| 761 | mbedtls_mpi_sub_abs:16:"00":16:"00":16:"":0 |
| 762 | |
| 763 | Test mbedtls_mpi_sub_abs: 1 - 0 (null) |
| 764 | mbedtls_mpi_sub_abs:16:"01":16:"":16:"01":0 |
| 765 | |
| 766 | Test mbedtls_mpi_sub_abs: 0 (null) - 1 |
| 767 | mbedtls_mpi_sub_abs:16:"":16:"01":16:"":MBEDTLS_ERR_MPI_NEGATIVE_VALUE |
| 768 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 769 | Test mbedtls_mpi_sub_abs #1 |
| 770 | mbedtls_mpi_sub_abs:16:"FFFFFFFFFF":16:"01":16:"FFFFFFFFFE":0 |
Paul Bakker | c847f07 | 2010-01-18 21:26:30 +0000 | [diff] [blame] | 771 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 772 | Test mbedtls_mpi_sub_abs #2 |
| 773 | mbedtls_mpi_sub_abs:16:"FFFFFFFFF0":16:"01":16:"FFFFFFFFEF":0 |
Paul Bakker | c847f07 | 2010-01-18 21:26:30 +0000 | [diff] [blame] | 774 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 775 | Test mbedtls_mpi_sub_abs #3 |
| 776 | mbedtls_mpi_sub_abs:16:"FF00000000":16:"0F00000000":16:"F000000000":0 |
Paul Bakker | c847f07 | 2010-01-18 21:26:30 +0000 | [diff] [blame] | 777 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 778 | Test mbedtls_mpi_sub_abs #4 |
| 779 | mbedtls_mpi_sub_abs:16:"FF00000000":16:"0F00000001":16:"EFFFFFFFFF":0 |
Paul Bakker | c847f07 | 2010-01-18 21:26:30 +0000 | [diff] [blame] | 780 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 781 | Base test mbedtls_mpi_sub_mpi #1 (Test with negative result) |
| 782 | mbedtls_mpi_sub_mpi:10:"5":10:"7":10:"-2" |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 783 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 784 | Base test mbedtls_mpi_sub_mpi #2 (Test with negative inputs) |
| 785 | mbedtls_mpi_sub_mpi:10:"-5":10:"-7":10:"2" |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 786 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 787 | Base test mbedtls_mpi_sub_mpi #3 (Test with negative base) |
| 788 | mbedtls_mpi_sub_mpi:10:"-5":10:"7":10:"-12" |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 789 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 790 | Base test mbedtls_mpi_sub_mpi #4 (Test with negative subtraction) |
| 791 | mbedtls_mpi_sub_mpi:10:"5":10:"-7":10:"12" |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 792 | |
Gilles Peskine | bc781ea | 2021-06-08 23:01:13 +0200 | [diff] [blame] | 793 | Test mbedtls_mpi_sub_mpi: 0 (null) - 0 (null) |
| 794 | mbedtls_mpi_sub_mpi:16:"":16:"":16:"" |
| 795 | |
| 796 | Test mbedtls_mpi_sub_mpi: 0 (null) - 0 (1 limb) |
| 797 | mbedtls_mpi_sub_mpi:16:"":16:"00":16:"" |
| 798 | |
| 799 | Test mbedtls_mpi_sub_mpi: 0 (null) - 1 |
| 800 | mbedtls_mpi_sub_mpi:16:"":16:"1":16:"-1" |
| 801 | |
| 802 | Test mbedtls_mpi_sub_mpi: 0 (null) - -1 |
| 803 | mbedtls_mpi_sub_mpi:16:"":16:"-1":16:"1" |
| 804 | |
| 805 | Test mbedtls_mpi_sub_mpi: 0 (1 limb) - 0 (null) |
| 806 | mbedtls_mpi_sub_mpi:16:"00":16:"":16:"" |
| 807 | |
| 808 | Test mbedtls_mpi_sub_mpi: 1 - 0 (null) |
| 809 | mbedtls_mpi_sub_mpi:16:"1":16:"":16:"1" |
| 810 | |
| 811 | Test mbedtls_mpi_sub_mpi: -1 - 0 (null) |
| 812 | mbedtls_mpi_sub_mpi:16:"-1":16:"":16:"-1" |
| 813 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 814 | Test mbedtls_mpi_sub_mpi #1 |
| 815 | mbedtls_mpi_sub_mpi:10:"531872289054204184185084734375133399408303613982130856645299464930952178606045848877129147820387996428175564228204785846141207532462936339834139412401975338705794646595487324365194792822189473092273993580587964571659678084484152603881094176995594813302284232006001752128168901293560051833646881436219":10:"203956878356401977405765866929034577280193993314348263094772646453283062722701277632936616063144088173312372882677123879538709400158306567338328279154499698366071906766440037074217117805690872792848149112022286332144876183376326512083574821647933992961249917319836219304274280243803104015000563790123":10:"327915410697802206779318867446098822128109620667782593550526818477669115883344571244192531757243908254863191345527661966602498132304629772495811133247475640339722739829047287290977675016498600299425844468565678239514801901107826091797519355347660820341034314686165532823894621049756947818646317646096" |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 816 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 817 | Test mbedtls_mpi_sub_mpi #2 (Test for negative result) |
| 818 | mbedtls_mpi_sub_mpi:10:"643808006803554439230129854961492699151386107534013432918073439524138264842370630061369715394739134090922937332590384720397133335969549256322620979036686633213903952966175107096769180017646161851573147596390153":10:"56125680981752282333498088313568935051383833838594899821664631784577337171193624243181360054669678410455329112434552942717084003541384594864129940145043086760031292483340068923506115878221189886491132772739661669044958531131327771":10:"-56125680981752282332854280306765380612153703983633407122513245677043323738275550803657221789827307780393959397039813808626161066208794210143732806809073537503708671504303382290292211925255014779394363592722015507193385383534937618" |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 819 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 820 | Test mbedtls_mpi_sub_int #1 |
| 821 | mbedtls_mpi_sub_int:10:"2039568783564019774057658669290345772801939933143482630947726464532830627227012776329":-9871232:10:"2039568783564019774057658669290345772801939933143482630947726464532830627227022647561" |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 822 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 823 | Test mbedtls_mpi_sub_int #2 |
| 824 | mbedtls_mpi_sub_int:10:"2039568783564019774057658669290345772801939933143482630947726464532830627227012776329":9871232:10:"2039568783564019774057658669290345772801939933143482630947726464532830627227002905097" |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 825 | |
Gilles Peskine | bc781ea | 2021-06-08 23:01:13 +0200 | [diff] [blame] | 826 | Test mbedtls_mpi_sub_int: 0 (null) - 0 |
| 827 | mbedtls_mpi_sub_int:16:"":0:16:"" |
| 828 | |
| 829 | Test mbedtls_mpi_sub_int: 0 (null) - 1 |
| 830 | mbedtls_mpi_sub_int:16:"":1:16:"-1" |
| 831 | |
| 832 | Test mbedtls_mpi_sub_int: 0 (null) - -1 |
| 833 | mbedtls_mpi_sub_int:16:"":-1:16:"1" |
| 834 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 835 | Test mbedtls_mpi_shift_l #1 |
| 836 | mbedtls_mpi_shift_l:10:"64":1:10:"128" |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 837 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 838 | Test mbedtls_mpi_shift_l #2 |
| 839 | mbedtls_mpi_shift_l:10:"658385546911733550164516088405238961461880256029834598831972039469421755117818013653494814438931957316403111689187691446941406788869098983929874080332195117465344344350008880118042764943201875870917468833709791733282363323948005998269792207":37:10:"90487820548639020691922304619723076305400961610119884872723190678642804168382367856686134531865643066983017249846286450251272364365605022750900439437595355052945035915579216557330505438734955340526145476988250171181404966718289259743378883640981192704" |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 840 | |
Gilles Peskine | bc781ea | 2021-06-08 23:01:13 +0200 | [diff] [blame] | 841 | Test mbedtls_mpi_shift_l: 0 (null) <<= 0 |
| 842 | mbedtls_mpi_shift_l:16:"":1:16:"" |
| 843 | |
| 844 | Test mbedtls_mpi_shift_l: 0 (null) <<= 1 |
| 845 | mbedtls_mpi_shift_l:16:"":1:16:"" |
| 846 | |
| 847 | Test mbedtls_mpi_shift_l: 0 (null) <<= 64 |
| 848 | mbedtls_mpi_shift_l:16:"":64:16:"" |
| 849 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 850 | Test mbedtls_mpi_shift_r #1 |
| 851 | mbedtls_mpi_shift_r:10:"128":1:10:"64" |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 852 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 853 | Test mbedtls_mpi_shift_r #2 |
| 854 | mbedtls_mpi_shift_r:10:"120815570979701484704906977000760567182871429114712069861589084706550626575967516787438008593490722779337547394120718248995900363209947025063336882559539208430319216688889117222633155838468458047056355241515415159736436403445579777425189969":45:10:"3433785053053426415343295076376096153094051405637175942660777670498379921354157795219578264137985649407981651226029903483433269093721578004287291678324982297860947730012217028349628999378309630601971640587504883789518896817457" |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 855 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 856 | Test mbedtls_mpi_shift_r #4 |
| 857 | mbedtls_mpi_shift_r:16:"FFFFFFFFFFFFFFFF":63:16:"01" |
Manuel Pégourié-Gonnard | e44ec10 | 2012-11-17 12:42:51 +0100 | [diff] [blame] | 858 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 859 | Test mbedtls_mpi_shift_r #4 |
| 860 | mbedtls_mpi_shift_r:16:"FFFFFFFFFFFFFFFF":64:16:"00" |
Manuel Pégourié-Gonnard | e44ec10 | 2012-11-17 12:42:51 +0100 | [diff] [blame] | 861 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 862 | Test mbedtls_mpi_shift_r #6 |
| 863 | mbedtls_mpi_shift_r:16:"FFFFFFFFFFFFFFFF":65:16:"00" |
Manuel Pégourié-Gonnard | e44ec10 | 2012-11-17 12:42:51 +0100 | [diff] [blame] | 864 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 865 | Test mbedtls_mpi_shift_r #7 |
| 866 | mbedtls_mpi_shift_r:16:"FFFFFFFFFFFFFFFF":128:16:"00" |
Manuel Pégourié-Gonnard | e44ec10 | 2012-11-17 12:42:51 +0100 | [diff] [blame] | 867 | |
Gilles Peskine | bc781ea | 2021-06-08 23:01:13 +0200 | [diff] [blame] | 868 | Test mbedtls_mpi_shift_r: 0 (null) >>= 0 |
| 869 | mbedtls_mpi_shift_r:16:"":0:16:"" |
| 870 | |
| 871 | Test mbedtls_mpi_shift_r: 0 (null) >>= 1 |
| 872 | mbedtls_mpi_shift_r:16:"":1:16:"" |
| 873 | |
| 874 | Test mbedtls_mpi_shift_r: 0 (null) >>= 64 |
| 875 | mbedtls_mpi_shift_r:16:"":64:16:"" |
| 876 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 877 | Base test mbedtls_mpi_mul_mpi #1 |
| 878 | mbedtls_mpi_mul_mpi:10:"5":10:"7":10:"35" |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 879 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 880 | Base test mbedtls_mpi_mul_mpi #2 |
| 881 | mbedtls_mpi_mul_mpi:10:"-5":10:"7":10:"-35" |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 882 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 883 | Base test mbedtls_mpi_mul_mpi #3 |
| 884 | mbedtls_mpi_mul_mpi:10:"5":10:"-7":10:"-35" |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 885 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 886 | Base test mbedtls_mpi_mul_mpi #4 |
| 887 | mbedtls_mpi_mul_mpi:10:"-5":10:"-7":10:"35" |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 888 | |
Gilles Peskine | bc781ea | 2021-06-08 23:01:13 +0200 | [diff] [blame] | 889 | Test mbedtls_mpi_mul_mpi: 0 (null) * 0 (null) |
| 890 | mbedtls_mpi_mul_mpi:16:"":16:"":16:"" |
| 891 | |
| 892 | Test mbedtls_mpi_mul_mpi: 0 (null) * 0 (1 limb) |
| 893 | mbedtls_mpi_mul_mpi:16:"":16:"00":16:"" |
| 894 | |
| 895 | Test mbedtls_mpi_mul_mpi: 0 (null) * 1 |
| 896 | mbedtls_mpi_mul_mpi:16:"":16:"01":16:"" |
| 897 | |
| 898 | Test mbedtls_mpi_mul_mpi: 0 (null) * -1 |
| 899 | mbedtls_mpi_mul_mpi:16:"":16:"-01":16:"" |
| 900 | |
| 901 | Test mbedtls_mpi_mul_mpi: 0 (1 limb) * 0 (null) |
| 902 | mbedtls_mpi_mul_mpi:16:"":16:"00":16:"" |
| 903 | |
| 904 | Test mbedtls_mpi_mul_mpi: 1 * 0 (null) |
| 905 | mbedtls_mpi_mul_mpi:16:"01":16:"":16:"" |
| 906 | |
| 907 | Test mbedtls_mpi_mul_mpi: -1 * 0 (null) |
| 908 | mbedtls_mpi_mul_mpi:16:"-01":16:"":16:"" |
| 909 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 910 | Test mbedtls_mpi_mul_mpi #1 |
| 911 | mbedtls_mpi_mul_mpi:10:"28911710017320205966167820725313234361535259163045867986277478145081076845846493521348693253530011243988160148063424837895971948244167867236923919506962312185829914482993478947657472351461336729641485069323635424692930278888923450060546465883490944265147851036817433970984747733020522259537":10:"16471581891701794764704009719057349996270239948993452268812975037240586099924712715366967486587417803753916334331355573776945238871512026832810626226164346328807407669366029926221415383560814338828449642265377822759768011406757061063524768140567867350208554439342320410551341675119078050953":10:"476221599179424887669515829231223263939342135681791605842540429321038144633323941248706405375723482912535192363845116154236465184147599697841273424891410002781967962186252583311115708128167171262206919514587899883547279647025952837516324649656913580411611297312678955801899536937577476819667861053063432906071315727948826276092545739432005962781562403795455162483159362585281248265005441715080197800335757871588045959754547836825977169125866324128449699877076762316768127816074587766799018626179199776188490087103869164122906791440101822594139648973454716256383294690817576188761" |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 912 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 913 | Test mbedtls_mpi_mul_int #1 |
| 914 | mbedtls_mpi_mul_int:10:"2039568783564019774057658669290345772801939933143482630947726464532830627227012776329":9871232:10:"20133056642518226042310730101376278483547239130123806338055387803943342738063359782107667328":"==" |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 915 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 916 | Test mbedtls_mpi_mul_int #2 (Unsigned, thus failure) |
| 917 | mbedtls_mpi_mul_int:10:"2039568783564019774057658669290345772801939933143482630947726464532830627227012776329":-9871232:10:"-20133056642518226042310730101376278483547239130123806338055387803943342738063359782107667328":"!=" |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 918 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 919 | Test mbedtls_mpi_mul_int #3 |
| 920 | mbedtls_mpi_mul_int:10:"-2039568783564019774057658669290345772801939933143482630947726464532830627227012776329":9871232:10:"-20133056642518226042310730101376278483547239130123806338055387803943342738063359782107667328":"==" |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 921 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 922 | Test mbedtls_mpi_mul_int #4 (Unsigned, thus failure) |
| 923 | mbedtls_mpi_mul_int:10:"-2039568783564019774057658669290345772801939933143482630947726464532830627227012776329":-9871232:10:"20133056642518226042310730101376278483547239130123806338055387803943342738063359782107667328":"!=" |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 924 | |
Gilles Peskine | bc781ea | 2021-06-08 23:01:13 +0200 | [diff] [blame] | 925 | Test mbedtls_mpi_mul_int: 0 (null) * 0 |
| 926 | mbedtls_mpi_mul_int:16:"":0:16:"":"==" |
| 927 | |
| 928 | Test mbedtls_mpi_mul_int: 0 (null) * 1 |
| 929 | mbedtls_mpi_mul_int:16:"":1:16:"":"==" |
| 930 | |
| 931 | Test mbedtls_mpi_mul_int: 0 (null) * 0x1234 |
| 932 | mbedtls_mpi_mul_int:16:"":0x1234:16:"":"==" |
| 933 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 934 | Base test mbedtls_mpi_div_mpi #1 |
| 935 | mbedtls_mpi_div_mpi:10:"1000":10:"13":10:"76":10:"12":0 |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 936 | |
Gilles Peskine | aa9d9ac | 2021-06-08 23:00:17 +0200 | [diff] [blame] | 937 | Base test mbedtls_mpi_div_mpi #2 (Divide by zero (1 limb)) |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 938 | mbedtls_mpi_div_mpi:10:"1000":10:"0":10:"1":10:"1":MBEDTLS_ERR_MPI_DIVISION_BY_ZERO |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 939 | |
Gilles Peskine | bc781ea | 2021-06-08 23:01:13 +0200 | [diff] [blame] | 940 | Base test mbedtls_mpi_div_mpi #2 (Divide by zero (null)) |
| 941 | mbedtls_mpi_div_mpi:10:"1000":10:"":10:"1":10:"1":MBEDTLS_ERR_MPI_DIVISION_BY_ZERO |
| 942 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 943 | Base test mbedtls_mpi_div_mpi #3 |
| 944 | mbedtls_mpi_div_mpi:10:"1000":10:"-13":10:"-76":10:"12":0 |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 945 | |
Gilles Peskine | bc781ea | 2021-06-08 23:01:13 +0200 | [diff] [blame] | 946 | Test mbedtls_mpi_div_mpi: 0 (null) / 0 (null) |
| 947 | mbedtls_mpi_div_mpi:16:"":16:"":16:"":16:"":MBEDTLS_ERR_MPI_DIVISION_BY_ZERO |
| 948 | |
| 949 | Test mbedtls_mpi_div_mpi: 0 (null) / 0 (1 limb) |
| 950 | mbedtls_mpi_div_mpi:16:"":16:"0":16:"":16:"":MBEDTLS_ERR_MPI_DIVISION_BY_ZERO |
| 951 | |
| 952 | Test mbedtls_mpi_div_mpi: 0 (1 limb) / 0 (null) |
| 953 | mbedtls_mpi_div_mpi:16:"0":16:"":16:"":16:"":MBEDTLS_ERR_MPI_DIVISION_BY_ZERO |
| 954 | |
| 955 | Test mbedtls_mpi_div_mpi: 0 (1 limb) / 0 (1 limb) |
| 956 | mbedtls_mpi_div_mpi:16:"0":16:"0":16:"":16:"":MBEDTLS_ERR_MPI_DIVISION_BY_ZERO |
| 957 | |
| 958 | Test mbedtls_mpi_div_mpi: 0 (null) / 1 |
| 959 | mbedtls_mpi_div_mpi:16:"":16:"1":16:"":16:"":0 |
| 960 | |
| 961 | Test mbedtls_mpi_div_mpi: 0 (null) / -1 |
| 962 | mbedtls_mpi_div_mpi:16:"":16:"-1":16:"":16:"":0 |
| 963 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 964 | Test mbedtls_mpi_div_mpi #1 |
| 965 | mbedtls_mpi_div_mpi:10:"20133056642518226042310730101376278483547239130123806338055387803943342738063359782107667328":10:"34":10:"592148724779947824773845002981655249516095268533053127589864347174804198178334111238460803":10:"26":0 |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 966 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 967 | Test mbedtls_mpi_div_mpi #2 |
| 968 | mbedtls_mpi_div_mpi:10:"476221599179424887669515829231223263939342135681791605842540429321038144633323941248706405375723482912535192363845116154236465184147599697841273424891410002781967962186252583311115708128167171262206919514587899883547279647025952837516324649656913580411611297312678955801899536937577476819667861053063432906071315727948826276092545739432005962781562403795455162483159362585281248265005441715080197800335757871588045959754547836825977169125866324128449699877076762316768127816074587766799018626179199776188490087103869164122906791440101822594139648973454716256383294690817576188762":10:"28911710017320205966167820725313234361535259163045867986277478145081076845846493521348693253530011243988160148063424837895971948244167867236923919506962312185829914482993478947657472351461336729641485069323635424692930278888923450060546465883490944265147851036817433970984747733020522259537":10:"16471581891701794764704009719057349996270239948993452268812975037240586099924712715366967486587417803753916334331355573776945238871512026832810626226164346328807407669366029926221415383560814338828449642265377822759768011406757061063524768140567867350208554439342320410551341675119078050953":10:"1":0 |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 969 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 970 | Test mbedtls_mpi_div_mpi #3 |
| 971 | mbedtls_mpi_div_mpi:10:"1000":10:"7":10:"142":10:"6":0 |
Paul Bakker | ba48cb2 | 2009-07-12 11:01:32 +0000 | [diff] [blame] | 972 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 973 | Test mbedtls_mpi_div_mpi #4 |
| 974 | mbedtls_mpi_div_mpi:10:"777":10:"7":10:"111":10:"0":0 |
Paul Bakker | ba48cb2 | 2009-07-12 11:01:32 +0000 | [diff] [blame] | 975 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 976 | Base test mbedtls_mpi_div_int #1 |
| 977 | mbedtls_mpi_div_int:10:"1000":13:10:"76":10:"12":0 |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 978 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 979 | Base test mbedtls_mpi_div_int #2 (Divide by zero) |
| 980 | mbedtls_mpi_div_int:10:"1000":0:10:"1":10:"1":MBEDTLS_ERR_MPI_DIVISION_BY_ZERO |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 981 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 982 | Base test mbedtls_mpi_div_int #3 |
| 983 | mbedtls_mpi_div_int:10:"1000":-13:10:"-76":10:"12":0 |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 984 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 985 | Test mbedtls_mpi_div_int #1 |
| 986 | mbedtls_mpi_div_int:10:"20133056642518226042310730101376278483547239130123806338055387803943342738063359782107667328":34:10:"592148724779947824773845002981655249516095268533053127589864347174804198178334111238460803":10:"26":0 |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 987 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 988 | Test mbedtls_mpi_div_int #2 |
| 989 | mbedtls_mpi_div_int:10:"20133056642518226042310730101376278483547239130123806338055387803943342738063359782107667328":-34:10:"-592148724779947824773845002981655249516095268533053127589864347174804198178334111238460803":10:"26":0 |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 990 | |
Gilles Peskine | bc781ea | 2021-06-08 23:01:13 +0200 | [diff] [blame] | 991 | Test mbedtls_mpi_div_int: 0 (null) / 0 |
| 992 | mbedtls_mpi_div_int:16:"":0:16:"":16:"":MBEDTLS_ERR_MPI_DIVISION_BY_ZERO |
| 993 | |
| 994 | Test mbedtls_mpi_div_int: 0 (1 limb) / 0 |
| 995 | mbedtls_mpi_div_int:16:"00":0:16:"":16:"":MBEDTLS_ERR_MPI_DIVISION_BY_ZERO |
| 996 | |
| 997 | Test mbedtls_mpi_div_int: 0 (null) / 1 |
| 998 | mbedtls_mpi_div_int:16:"":1:16:"":16:"":0 |
| 999 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1000 | Base test mbedtls_mpi_mod_mpi #1 |
| 1001 | mbedtls_mpi_mod_mpi:10:"1000":10:"13":10:"12":0 |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 1002 | |
Gilles Peskine | bc781ea | 2021-06-08 23:01:13 +0200 | [diff] [blame] | 1003 | Base test mbedtls_mpi_mod_mpi #2 (Divide by zero (null)) |
| 1004 | mbedtls_mpi_mod_mpi:10:"1000":10:"":10:"0":MBEDTLS_ERR_MPI_DIVISION_BY_ZERO |
| 1005 | |
Gilles Peskine | aa9d9ac | 2021-06-08 23:00:17 +0200 | [diff] [blame] | 1006 | Base test mbedtls_mpi_mod_mpi #2 (Divide by zero (1 limb)) |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1007 | mbedtls_mpi_mod_mpi:10:"1000":10:"0":10:"0":MBEDTLS_ERR_MPI_DIVISION_BY_ZERO |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 1008 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1009 | Base test mbedtls_mpi_mod_mpi #3 |
| 1010 | mbedtls_mpi_mod_mpi:10:"-1000":10:"13":10:"1":0 |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 1011 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1012 | Base test mbedtls_mpi_mod_mpi #4 (Negative modulo) |
| 1013 | mbedtls_mpi_mod_mpi:10:"1000":10:"-13":10:"-1":MBEDTLS_ERR_MPI_NEGATIVE_VALUE |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 1014 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1015 | Base test mbedtls_mpi_mod_mpi #5 (Negative modulo) |
| 1016 | mbedtls_mpi_mod_mpi:10:"-1000":10:"-13":10:"-12":MBEDTLS_ERR_MPI_NEGATIVE_VALUE |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 1017 | |
Gilles Peskine | bc781ea | 2021-06-08 23:01:13 +0200 | [diff] [blame] | 1018 | Test mbedtls_mpi_mod_mpi: 0 (null) % 1 |
| 1019 | mbedtls_mpi_mod_mpi:16:"":16:"1":16:"":0 |
| 1020 | |
| 1021 | Test mbedtls_mpi_mod_mpi: 0 (null) % -1 |
| 1022 | mbedtls_mpi_mod_mpi:16:"":16:"-1":16:"":MBEDTLS_ERR_MPI_NEGATIVE_VALUE |
| 1023 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1024 | Base test mbedtls_mpi_mod_int #1 |
| 1025 | mbedtls_mpi_mod_int:10:"1000":13:12:0 |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 1026 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1027 | Base test mbedtls_mpi_mod_int #2 (Divide by zero) |
| 1028 | mbedtls_mpi_mod_int:10:"1000":0:0:MBEDTLS_ERR_MPI_DIVISION_BY_ZERO |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 1029 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1030 | Base test mbedtls_mpi_mod_int #3 |
| 1031 | mbedtls_mpi_mod_int:10:"-1000":13:1:0 |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 1032 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1033 | Base test mbedtls_mpi_mod_int #4 (Negative modulo) |
| 1034 | mbedtls_mpi_mod_int:10:"1000":-13:0:MBEDTLS_ERR_MPI_NEGATIVE_VALUE |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 1035 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1036 | Base test mbedtls_mpi_mod_int #5 (Negative modulo) |
| 1037 | mbedtls_mpi_mod_int:10:"-1000":-13:0:MBEDTLS_ERR_MPI_NEGATIVE_VALUE |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 1038 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1039 | Base test mbedtls_mpi_mod_int #6 (By 1) |
| 1040 | mbedtls_mpi_mod_int:10:"1000":1:0:0 |
Paul Bakker | ba48cb2 | 2009-07-12 11:01:32 +0000 | [diff] [blame] | 1041 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1042 | Base test mbedtls_mpi_mod_int #7 (By 2) |
| 1043 | mbedtls_mpi_mod_int:10:"1001":2:1:0 |
Paul Bakker | ba48cb2 | 2009-07-12 11:01:32 +0000 | [diff] [blame] | 1044 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1045 | Base test mbedtls_mpi_mod_int #8 (By 2) |
| 1046 | mbedtls_mpi_mod_int:10:"1000":2:0:0 |
Paul Bakker | ba48cb2 | 2009-07-12 11:01:32 +0000 | [diff] [blame] | 1047 | |
Gilles Peskine | bc781ea | 2021-06-08 23:01:13 +0200 | [diff] [blame] | 1048 | Test mbedtls_mpi_mod_int: 0 (null) % 1 |
| 1049 | mbedtls_mpi_mod_int:16:"":1:0:0 |
| 1050 | |
| 1051 | Test mbedtls_mpi_mod_int: 0 (null) % -1 |
| 1052 | mbedtls_mpi_mod_int:16:"":-1:0:MBEDTLS_ERR_MPI_NEGATIVE_VALUE |
| 1053 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1054 | Base test mbedtls_mpi_exp_mod #1 |
Gilles Peskine | cca6bb9 | 2021-06-09 18:28:35 +0200 | [diff] [blame] | 1055 | mbedtls_mpi_exp_mod:10:"23":10:"13":10:"29":10:"24":0 |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 1056 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1057 | Base test mbedtls_mpi_exp_mod #2 (Even N) |
Gilles Peskine | cca6bb9 | 2021-06-09 18:28:35 +0200 | [diff] [blame] | 1058 | mbedtls_mpi_exp_mod:10:"23":10:"13":10:"30":10:"0":MBEDTLS_ERR_MPI_BAD_INPUT_DATA |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 1059 | |
Gilles Peskine | bc781ea | 2021-06-08 23:01:13 +0200 | [diff] [blame] | 1060 | Base test mbedtls_mpi_exp_mod #2 (N = 0 (null)) |
| 1061 | mbedtls_mpi_exp_mod:10:"23":10:"13":10:"":10:"0":MBEDTLS_ERR_MPI_BAD_INPUT_DATA |
| 1062 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1063 | Base test mbedtls_mpi_exp_mod #3 (Negative N) |
Gilles Peskine | cca6bb9 | 2021-06-09 18:28:35 +0200 | [diff] [blame] | 1064 | mbedtls_mpi_exp_mod:10:"23":10:"13":10:"-29":10:"0":MBEDTLS_ERR_MPI_BAD_INPUT_DATA |
Paul Bakker | f6198c1 | 2012-05-16 08:02:29 +0000 | [diff] [blame] | 1065 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1066 | Base test mbedtls_mpi_exp_mod #4 (Negative base) |
Gilles Peskine | cca6bb9 | 2021-06-09 18:28:35 +0200 | [diff] [blame] | 1067 | mbedtls_mpi_exp_mod:10:"-23":10:"13":10:"29":10:"5":0 |
Paul Bakker | f6198c1 | 2012-05-16 08:02:29 +0000 | [diff] [blame] | 1068 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1069 | Base test mbedtls_mpi_exp_mod #5 (Negative exponent) |
Gilles Peskine | cca6bb9 | 2021-06-09 18:28:35 +0200 | [diff] [blame] | 1070 | mbedtls_mpi_exp_mod:10:"23":10:"-13":10:"29":10:"0":MBEDTLS_ERR_MPI_BAD_INPUT_DATA |
Paul Bakker | f6198c1 | 2012-05-16 08:02:29 +0000 | [diff] [blame] | 1071 | |
Chris Jones | 63d19c0 | 2020-11-26 11:21:53 +0000 | [diff] [blame] | 1072 | Base test mbedtls_mpi_exp_mod #6 (Negative base + exponent) |
Gilles Peskine | cca6bb9 | 2021-06-09 18:28:35 +0200 | [diff] [blame] | 1073 | mbedtls_mpi_exp_mod:10:"-23":10:"-13":10:"29":10:"0":MBEDTLS_ERR_MPI_BAD_INPUT_DATA |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 1074 | |
Gilles Peskine | bc781ea | 2021-06-08 23:01:13 +0200 | [diff] [blame] | 1075 | Test mbedtls_mpi_exp_mod: 0 (null) ^ 0 (null) mod 9 |
Gilles Peskine | bc781ea | 2021-06-08 23:01:13 +0200 | [diff] [blame] | 1076 | mbedtls_mpi_exp_mod:16:"":16:"":16:"09":16:"1":0 |
| 1077 | |
| 1078 | Test mbedtls_mpi_exp_mod: 0 (null) ^ 0 (1 limb) mod 9 |
Gilles Peskine | bc781ea | 2021-06-08 23:01:13 +0200 | [diff] [blame] | 1079 | mbedtls_mpi_exp_mod:16:"":16:"00":16:"09":16:"1":0 |
| 1080 | |
| 1081 | Test mbedtls_mpi_exp_mod: 0 (null) ^ 1 mod 9 |
Gilles Peskine | bc781ea | 2021-06-08 23:01:13 +0200 | [diff] [blame] | 1082 | mbedtls_mpi_exp_mod:16:"":16:"01":16:"09":16:"":0 |
| 1083 | |
| 1084 | Test mbedtls_mpi_exp_mod: 0 (null) ^ 2 mod 9 |
Gilles Peskine | bc781ea | 2021-06-08 23:01:13 +0200 | [diff] [blame] | 1085 | mbedtls_mpi_exp_mod:16:"":16:"02":16:"09":16:"":0 |
| 1086 | |
| 1087 | Test mbedtls_mpi_exp_mod: 0 (1 limb) ^ 0 (null) mod 9 |
| 1088 | mbedtls_mpi_exp_mod:16:"00":16:"":16:"09":16:"1":0 |
| 1089 | |
| 1090 | Test mbedtls_mpi_exp_mod: 0 (1 limb) ^ 0 (1 limb) mod 9 |
| 1091 | mbedtls_mpi_exp_mod:16:"00":16:"00":16:"09":16:"1":0 |
| 1092 | |
| 1093 | Test mbedtls_mpi_exp_mod: 0 (1 limb) ^ 1 mod 9 |
| 1094 | mbedtls_mpi_exp_mod:16:"00":16:"01":16:"09":16:"":0 |
| 1095 | |
| 1096 | Test mbedtls_mpi_exp_mod: 0 (1 limb) ^ 2 mod 9 |
| 1097 | mbedtls_mpi_exp_mod:16:"00":16:"02":16:"09":16:"":0 |
| 1098 | |
| 1099 | Test mbedtls_mpi_exp_mod: 1 ^ 0 (null) mod 9 |
| 1100 | mbedtls_mpi_exp_mod:16:"01":16:"":16:"09":16:"1":0 |
| 1101 | |
| 1102 | Test mbedtls_mpi_exp_mod: 4 ^ 0 (null) mod 9 |
| 1103 | mbedtls_mpi_exp_mod:16:"04":16:"":16:"09":16:"1":0 |
| 1104 | |
| 1105 | Test mbedtls_mpi_exp_mod: 10 ^ 0 (null) mod 9 |
| 1106 | mbedtls_mpi_exp_mod:16:"0a":16:"":16:"09":16:"1":0 |
| 1107 | |
| 1108 | Test mbedtls_mpi_exp_mod: 1 ^ 0 (1 limb) mod 9 |
| 1109 | mbedtls_mpi_exp_mod:16:"01":16:"00":16:"09":16:"1":0 |
| 1110 | |
| 1111 | Test mbedtls_mpi_exp_mod: 4 ^ 0 (1 limb) mod 9 |
| 1112 | mbedtls_mpi_exp_mod:16:"04":16:"00":16:"09":16:"1":0 |
| 1113 | |
| 1114 | Test mbedtls_mpi_exp_mod: 10 ^ 0 (1 limb) mod 9 |
| 1115 | mbedtls_mpi_exp_mod:16:"0a":16:"00":16:"09":16:"1":0 |
| 1116 | |
Chris Jones | a18813e | 2020-12-03 11:35:41 +0000 | [diff] [blame] | 1117 | Test mbedtls_mpi_exp_mod: MAX_SIZE exponent |
Chris Jones | 877329a | 2020-12-03 11:52:40 +0000 | [diff] [blame] | 1118 | mbedtls_mpi_exp_mod_size:2:MBEDTLS_MPI_MAX_SIZE:10:10:"":0 |
Chris Jones | 415c7be | 2020-12-02 10:41:50 +0000 | [diff] [blame] | 1119 | |
Chris Jones | a18813e | 2020-12-03 11:35:41 +0000 | [diff] [blame] | 1120 | Test mbedtls_mpi_exp_mod: MAX_SIZE + 1 exponent |
Chris Jones | 877329a | 2020-12-03 11:52:40 +0000 | [diff] [blame] | 1121 | mbedtls_mpi_exp_mod_size:2:MBEDTLS_MPI_MAX_SIZE + 1:10:10:"":MBEDTLS_ERR_MPI_BAD_INPUT_DATA |
Chris Jones | 415c7be | 2020-12-02 10:41:50 +0000 | [diff] [blame] | 1122 | |
Chris Jones | a18813e | 2020-12-03 11:35:41 +0000 | [diff] [blame] | 1123 | Test mbedtls_mpi_exp_mod: MAX_SIZE modulus |
Chris Jones | 415c7be | 2020-12-02 10:41:50 +0000 | [diff] [blame] | 1124 | mbedtls_mpi_exp_mod_size:2:2:MBEDTLS_MPI_MAX_SIZE:10:"":0 |
| 1125 | |
Chris Jones | a18813e | 2020-12-03 11:35:41 +0000 | [diff] [blame] | 1126 | Test mbedtls_mpi_exp_mod: MAX_SIZE + 1 modulus |
Chris Jones | 415c7be | 2020-12-02 10:41:50 +0000 | [diff] [blame] | 1127 | mbedtls_mpi_exp_mod_size:2:2:MBEDTLS_MPI_MAX_SIZE + 1:10:"":MBEDTLS_ERR_MPI_BAD_INPUT_DATA |
Chris Jones | 63d19c0 | 2020-11-26 11:21:53 +0000 | [diff] [blame] | 1128 | |
Chris Jones | a18813e | 2020-12-03 11:35:41 +0000 | [diff] [blame] | 1129 | Test mbedtls_mpi_exp_mod: MAX_SIZE exponent and modulus |
Chris Jones | 4a0ccb6 | 2020-12-02 16:27:42 +0000 | [diff] [blame] | 1130 | mbedtls_mpi_exp_mod_size:2:MBEDTLS_MPI_MAX_SIZE:MBEDTLS_MPI_MAX_SIZE:10:"":0 |
| 1131 | |
Chris Jones | a18813e | 2020-12-03 11:35:41 +0000 | [diff] [blame] | 1132 | Test mbedtls_mpi_exp_mod: MAX_SIZE + 1 exponent and modulus |
Chris Jones | 4a0ccb6 | 2020-12-02 16:27:42 +0000 | [diff] [blame] | 1133 | mbedtls_mpi_exp_mod_size:2:MBEDTLS_MPI_MAX_SIZE + 1:MBEDTLS_MPI_MAX_SIZE + 1:10:"":MBEDTLS_ERR_MPI_BAD_INPUT_DATA |
| 1134 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1135 | Test mbedtls_mpi_exp_mod #1 |
Chris Jones | 5dd1e26 | 2020-12-03 17:44:03 +0000 | [diff] [blame] | 1136 | depends_on:MPI_MAX_BITS_LARGER_THAN_792 |
Gilles Peskine | cca6bb9 | 2021-06-09 18:28:35 +0200 | [diff] [blame] | 1137 | mbedtls_mpi_exp_mod:10:"433019240910377478217373572959560109819648647016096560523769010881172869083338285573756574557395862965095016483867813043663981946477698466501451832407592327356331263124555137732393938242285782144928753919588632679050799198937132922145084847":10:"5781538327977828897150909166778407659250458379645823062042492461576758526757490910073628008613977550546382774775570888130029763571528699574717583228939535960234464230882573615930384979100379102915657483866755371559811718767760594919456971354184113721":10:"583137007797276923956891216216022144052044091311388601652961409557516421612874571554415606746479105795833145583959622117418531166391184939066520869800857530421873250114773204354963864729386957427276448683092491947566992077136553066273207777134303397724679138833126700957":10:"114597449276684355144920670007147953232659436380163461553186940113929777196018164149703566472936578890991049344459204199888254907113495794730452699842273939581048142004834330369483813876618772578869083248061616444392091693787039636316845512292127097865026290173004860736":0 |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 1138 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1139 | Test mbedtls_mpi_exp_mod (Negative base) |
Gilles Peskine | cca6bb9 | 2021-06-09 18:28:35 +0200 | [diff] [blame] | 1140 | mbedtls_mpi_exp_mod:10:"-10000000000":10:"10000000000":10:"99999":10:"1":0 |
Paul Bakker | f6198c1 | 2012-05-16 08:02:29 +0000 | [diff] [blame] | 1141 | |
Chris Jones | 49e6e9d | 2020-12-03 15:22:25 +0000 | [diff] [blame] | 1142 | Test mbedtls_mpi_exp_mod (Negative base) [#2] |
Chris Jones | 5dd1e26 | 2020-12-03 17:44:03 +0000 | [diff] [blame] | 1143 | depends_on:MPI_MAX_BITS_LARGER_THAN_792 |
Gilles Peskine | cca6bb9 | 2021-06-09 18:28:35 +0200 | [diff] [blame] | 1144 | mbedtls_mpi_exp_mod:16:"-9f13012cd92aa72fb86ac8879d2fde4f7fd661aaae43a00971f081cc60ca277059d5c37e89652e2af2585d281d66ef6a9d38a117e9608e9e7574cd142dc55278838a2161dd56db9470d4c1da2d5df15a908ee2eb886aaa890f23be16de59386663a12f1afbb325431a3e835e3fd89b98b96a6f77382f458ef9a37e1f84a03045c8676ab55291a94c2228ea15448ee96b626b998":16:"40a54d1b9e86789f06d9607fb158672d64867665c73ee9abb545fc7a785634b354c7bae5b962ce8040cf45f2c1f3d3659b2ee5ede17534c8fc2ec85c815e8df1fe7048d12c90ee31b88a68a081f17f0d8ce5f4030521e9400083bcea73a429031d4ca7949c2000d597088e0c39a6014d8bf962b73bb2e8083bd0390a4e00b9b3":16:"eeaf0ab9adb38dd69c33f80afa8fc5e86072618775ff3c0b9ea2314c9c256576d674df7496ea81d3383b4813d692c6e0e0d5d8e250b98be48e495c1d6089dad15dc7d7b46154d6b6ce8ef4ad69b15d4982559b297bcf1885c529f566660e57ec68edbc3c05726cc02fd4cbf4976eaa9afd5138fe8376435b9fc61d2fc0eb06e3":16:"21acc7199e1b90f9b4844ffe12c19f00ec548c5d32b21c647d48b6015d8eb9ec9db05b4f3d44db4227a2b5659c1a7cceb9d5fa8fa60376047953ce7397d90aaeb7465e14e820734f84aa52ad0fc66701bcbb991d57715806a11531268e1e83dd48288c72b424a6287e9ce4e5cc4db0dd67614aecc23b0124a5776d36e5c89483":0 |
Paul Bakker | f6198c1 | 2012-05-16 08:02:29 +0000 | [diff] [blame] | 1145 | |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 1146 | Base test GCD #1 |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1147 | mbedtls_mpi_gcd:10:"693":10:"609":10:"21" |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 1148 | |
| 1149 | Base test GCD #2 |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1150 | mbedtls_mpi_gcd:10:"1764":10:"868":10:"28" |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 1151 | |
| 1152 | Base test GCD #3 |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1153 | mbedtls_mpi_gcd:10:"768454923":10:"542167814":10:"1" |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 1154 | |
Gilles Peskine | bc781ea | 2021-06-08 23:01:13 +0200 | [diff] [blame] | 1155 | Test GCD: 0 (null), 0 (null) |
| 1156 | mbedtls_mpi_gcd:16:"":16:"":16:"" |
| 1157 | |
| 1158 | Test GCD: 0 (null), 0 (1 limb) |
| 1159 | mbedtls_mpi_gcd:16:"":16:"00":16:"" |
| 1160 | |
| 1161 | Test GCD: 0 (null), 3 |
| 1162 | mbedtls_mpi_gcd:16:"":16:"03":16:"3" |
| 1163 | |
| 1164 | Test GCD: 0 (null), 6 |
| 1165 | mbedtls_mpi_gcd:16:"":16:"06":16:"6" |
| 1166 | |
| 1167 | Test GCD: 0 (1 limb), 0 (null) |
| 1168 | mbedtls_mpi_gcd:16:"00":16:"00":16:"" |
| 1169 | |
| 1170 | Test GCD: 0 (1 limb), 3 |
| 1171 | mbedtls_mpi_gcd:16:"00":16:"03":16:"3" |
| 1172 | |
| 1173 | Test GCD: 0 (1 limb), 6 |
| 1174 | mbedtls_mpi_gcd:16:"00":16:"06":16:"6" |
| 1175 | |
| 1176 | Test GCD: 3, 0 (null) |
| 1177 | mbedtls_mpi_gcd:16:"03":16:"":16:"3" |
| 1178 | |
| 1179 | Test GCD: 3, 0 (1 limb) |
| 1180 | mbedtls_mpi_gcd:16:"03":16:"00":16:"3" |
| 1181 | |
| 1182 | Test GCD: 6, 0 (null) |
| 1183 | mbedtls_mpi_gcd:16:"06":16:"":16:"6" |
| 1184 | |
| 1185 | Test GCD: 6, 0 (1 limb) |
| 1186 | mbedtls_mpi_gcd:16:"06":16:"00":16:"6" |
| 1187 | |
Gilles Peskine | 9e8316e | 2021-06-09 10:52:12 +0200 | [diff] [blame] | 1188 | Test GCD #1: A > 0, B > 0 |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1189 | mbedtls_mpi_gcd:10:"433019240910377478217373572959560109819648647016096560523769010881172869083338285573756574557395862965095016483867813043663981946477698466501451832407592327356331263124555137732393938242285782144928753919588632679050799198937132922145084847":10:"5781538327977828897150909166778407659250458379645823062042492461576758526757490910073628008613977550546382774775570888130029763571528699574717583228939535960234464230882573615930384979100379102915657483866755371559811718767760594919456971354184113721":10:"1" |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 1190 | |
Gilles Peskine | 9e8316e | 2021-06-09 10:52:12 +0200 | [diff] [blame] | 1191 | Test GCD #1 with A > B |
| 1192 | mbedtls_mpi_gcd:10:"5781538327977828897150909166778407659250458379645823062042492461576758526757490910073628008613977550546382774775570888130029763571528699574717583228939535960234464230882573615930384979100379102915657483866755371559811718767760594919456971354184113721":10:"433019240910377478217373572959560109819648647016096560523769010881172869083338285573756574557395862965095016483867813043663981946477698466501451832407592327356331263124555137732393938242285782144928753919588632679050799198937132922145084847":10:"1" |
| 1193 | |
| 1194 | Test GCD #1: A > 0, B < 0 |
| 1195 | mbedtls_mpi_gcd:10:"433019240910377478217373572959560109819648647016096560523769010881172869083338285573756574557395862965095016483867813043663981946477698466501451832407592327356331263124555137732393938242285782144928753919588632679050799198937132922145084847":10:"-5781538327977828897150909166778407659250458379645823062042492461576758526757490910073628008613977550546382774775570888130029763571528699574717583228939535960234464230882573615930384979100379102915657483866755371559811718767760594919456971354184113721":10:"1" |
| 1196 | |
| 1197 | Test GCD #1: A < 0, B > 0 |
| 1198 | mbedtls_mpi_gcd:10:"-433019240910377478217373572959560109819648647016096560523769010881172869083338285573756574557395862965095016483867813043663981946477698466501451832407592327356331263124555137732393938242285782144928753919588632679050799198937132922145084847":10:"5781538327977828897150909166778407659250458379645823062042492461576758526757490910073628008613977550546382774775570888130029763571528699574717583228939535960234464230882573615930384979100379102915657483866755371559811718767760594919456971354184113721":10:"1" |
| 1199 | |
| 1200 | Test GCD #1: A < 0, B < 0 |
| 1201 | mbedtls_mpi_gcd:10:"-433019240910377478217373572959560109819648647016096560523769010881172869083338285573756574557395862965095016483867813043663981946477698466501451832407592327356331263124555137732393938242285782144928753919588632679050799198937132922145084847":10:"-5781538327977828897150909166778407659250458379645823062042492461576758526757490910073628008613977550546382774775570888130029763571528699574717583228939535960234464230882573615930384979100379102915657483866755371559811718767760594919456971354184113721":10:"1" |
| 1202 | |
| 1203 | Test GCD #2 |
| 1204 | mbedtls_mpi_gcd:10:"866038481820754956434747145919120219639297294032193121047538021762345738166676571147513149114791725930190032967735626087327963892955396933002903664815184654712662526249110275464787876484571564289857507839177265358101598397874265844290169694":10:"11563076655955657794301818333556815318500916759291646124084984923153517053514981820147256017227955101092765549551141776260059527143057399149435166457879071920468928461765147231860769958200758205831314967733510743119623437535521189838913942708368227442":10:"2" |
| 1205 | |
| 1206 | Test GCD #2 with A > B |
| 1207 | mbedtls_mpi_gcd:10:"11563076655955657794301818333556815318500916759291646124084984923153517053514981820147256017227955101092765549551141776260059527143057399149435166457879071920468928461765147231860769958200758205831314967733510743119623437535521189838913942708368227442":10:"866038481820754956434747145919120219639297294032193121047538021762345738166676571147513149114791725930190032967735626087327963892955396933002903664815184654712662526249110275464787876484571564289857507839177265358101598397874265844290169694":10:"2" |
| 1208 | |
| 1209 | Test GCD #3 |
| 1210 | mbedtls_mpi_gcd:10:"1299057722731132434652120718878680329458945941048289681571307032643518607250014856721269723672187588895285049451603439130991945839433095399504355497222776982068993789373665413197181814726857346434786261758765898037152397596811398766435254541":10:"17344614983933486691452727500335222977751375138937469186127477384730275580272472730220884025841932651639148324326712664390089290714586098724152749686818607880703392692647720847791154937301137308746972451600266114679435156303281784758370914062552341163":10:"3" |
| 1211 | |
| 1212 | Test GCD #3 with A > B |
| 1213 | mbedtls_mpi_gcd:10:"17344614983933486691452727500335222977751375138937469186127477384730275580272472730220884025841932651639148324326712664390089290714586098724152749686818607880703392692647720847791154937301137308746972451600266114679435156303281784758370914062552341163":10:"1299057722731132434652120718878680329458945941048289681571307032643518607250014856721269723672187588895285049451603439130991945839433095399504355497222776982068993789373665413197181814726857346434786261758765898037152397596811398766435254541":10:"3" |
| 1214 | |
| 1215 | Test GCD #4 |
| 1216 | mbedtls_mpi_gcd:10:"1732076963641509912869494291838240439278594588064386242095076043524691476333353142295026298229583451860380065935471252174655927785910793866005807329630369309425325052498220550929575752969143128579715015678354530716203196795748531688580339388":10:"23126153311911315588603636667113630637001833518583292248169969846307034107029963640294512034455910202185531099102283552520119054286114798298870332915758143840937856923530294463721539916401516411662629935467021486239246875071042379677827885416736454884":10:"4" |
| 1217 | |
| 1218 | Test GCD #4 with A > B |
| 1219 | mbedtls_mpi_gcd:10:"23126153311911315588603636667113630637001833518583292248169969846307034107029963640294512034455910202185531099102283552520119054286114798298870332915758143840937856923530294463721539916401516411662629935467021486239246875071042379677827885416736454884":10:"1732076963641509912869494291838240439278594588064386242095076043524691476333353142295026298229583451860380065935471252174655927785910793866005807329630369309425325052498220550929575752969143128579715015678354530716203196795748531688580339388":10:"4" |
| 1220 | |
| 1221 | Test GCD #6 |
| 1222 | mbedtls_mpi_gcd:10:"2598115445462264869304241437757360658917891882096579363142614065287037214500029713442539447344375177790570098903206878261983891678866190799008710994445553964137987578747330826394363629453714692869572523517531796074304795193622797532870509082":10:"34689229967866973382905455000670445955502750277874938372254954769460551160544945460441768051683865303278296648653425328780178581429172197448305499373637215761406785385295441695582309874602274617493944903200532229358870312606563569516741828125104682326":10:"6" |
| 1223 | |
| 1224 | Test GCD #5 (A = B) |
| 1225 | mbedtls_mpi_gcd:10:"433019240910377478217373572959560109819648647016096560523769010881172869083338285573756574557395862965095016483867813043663981946477698466501451832407592327356331263124555137732393938242285782144928753919588632679050799198937132922145084847":10:"433019240910377478217373572959560109819648647016096560523769010881172869083338285573756574557395862965095016483867813043663981946477698466501451832407592327356331263124555137732393938242285782144928753919588632679050799198937132922145084847":10:"433019240910377478217373572959560109819648647016096560523769010881172869083338285573756574557395862965095016483867813043663981946477698466501451832407592327356331263124555137732393938242285782144928753919588632679050799198937132922145084847" |
| 1226 | |
| 1227 | Test GCD #6 with A > B |
| 1228 | mbedtls_mpi_gcd:10:"34689229967866973382905455000670445955502750277874938372254954769460551160544945460441768051683865303278296648653425328780178581429172197448305499373637215761406785385295441695582309874602274617493944903200532229358870312606563569516741828125104682326":10:"2598115445462264869304241437757360658917891882096579363142614065287037214500029713442539447344375177790570098903206878261983891678866190799008710994445553964137987578747330826394363629453714692869572523517531796074304795193622797532870509082":10:"6" |
| 1229 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1230 | Base test mbedtls_mpi_inv_mod #1 |
| 1231 | mbedtls_mpi_inv_mod:10:"3":10:"11":10:"4":0 |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 1232 | |
Gilles Peskine | bc781ea | 2021-06-08 23:01:13 +0200 | [diff] [blame] | 1233 | Test mbedtls_mpi_inv_mod: mod 0 (null) |
| 1234 | mbedtls_mpi_inv_mod:10:"3":10:"":10:"0":MBEDTLS_ERR_MPI_BAD_INPUT_DATA |
| 1235 | |
Gilles Peskine | aa9d9ac | 2021-06-08 23:00:17 +0200 | [diff] [blame] | 1236 | Test mbedtls_mpi_inv_mod: mod 0 (1 limb) |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1237 | mbedtls_mpi_inv_mod:10:"3":10:"0":10:"0":MBEDTLS_ERR_MPI_BAD_INPUT_DATA |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 1238 | |
Gilles Peskine | aa9d9ac | 2021-06-08 23:00:17 +0200 | [diff] [blame] | 1239 | Test mbedtls_mpi_inv_mod: mod negative |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1240 | mbedtls_mpi_inv_mod:10:"3":10:"-11":10:"4":MBEDTLS_ERR_MPI_BAD_INPUT_DATA |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 1241 | |
Gilles Peskine | aa9d9ac | 2021-06-08 23:00:17 +0200 | [diff] [blame] | 1242 | Test mbedtls_mpi_inv_mod: 2^-1 mod 4 |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1243 | mbedtls_mpi_inv_mod:10:"2":10:"4":10:"0":MBEDTLS_ERR_MPI_NOT_ACCEPTABLE |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 1244 | |
Gilles Peskine | aa9d9ac | 2021-06-08 23:00:17 +0200 | [diff] [blame] | 1245 | Test mbedtls_mpi_inv_mod: mod 1 |
Hanno Becker | 4bcb491 | 2017-04-18 15:49:39 +0100 | [diff] [blame] | 1246 | mbedtls_mpi_inv_mod:10:"3":10:"1":10:"0":MBEDTLS_ERR_MPI_BAD_INPUT_DATA |
| 1247 | |
Gilles Peskine | bc781ea | 2021-06-08 23:01:13 +0200 | [diff] [blame] | 1248 | Test mbedtls_mpi_inv_mod: 0 (null) ^-1 |
| 1249 | mbedtls_mpi_inv_mod:16:"":16:"11":16:"":MBEDTLS_ERR_MPI_NOT_ACCEPTABLE |
| 1250 | |
| 1251 | Test mbedtls_mpi_inv_mod: 0 (1 limb) ^-1 |
| 1252 | mbedtls_mpi_inv_mod:16:"00":16:"11":16:"":MBEDTLS_ERR_MPI_NOT_ACCEPTABLE |
| 1253 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1254 | Test mbedtls_mpi_inv_mod #1 |
| 1255 | mbedtls_mpi_inv_mod:16:"aa4df5cb14b4c31237f98bd1faf527c283c2d0f3eec89718664ba33f9762907c":16:"fffbbd660b94412ae61ead9c2906a344116e316a256fd387874c6c675b1d587d":16:"8d6a5c1d7adeae3e94b9bcd2c47e0d46e778bc8804a2cc25c02d775dc3d05b0c":0 |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 1256 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1257 | Base test mbedtls_mpi_is_prime #1 |
| 1258 | depends_on:MBEDTLS_GENPRIME |
| 1259 | mbedtls_mpi_is_prime:10:"0":MBEDTLS_ERR_MPI_NOT_ACCEPTABLE |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 1260 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1261 | Base test mbedtls_mpi_is_prime #2 |
| 1262 | depends_on:MBEDTLS_GENPRIME |
| 1263 | mbedtls_mpi_is_prime:10:"1":MBEDTLS_ERR_MPI_NOT_ACCEPTABLE |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 1264 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1265 | Base test mbedtls_mpi_is_prime #3 |
| 1266 | depends_on:MBEDTLS_GENPRIME |
| 1267 | mbedtls_mpi_is_prime:10:"2":0 |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 1268 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1269 | Base test mbedtls_mpi_is_prime #4 |
| 1270 | depends_on:MBEDTLS_GENPRIME |
| 1271 | mbedtls_mpi_is_prime:10:"3":0 |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 1272 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1273 | Base test mbedtls_mpi_is_prime #5 |
| 1274 | depends_on:MBEDTLS_GENPRIME |
| 1275 | mbedtls_mpi_is_prime:10:"4":MBEDTLS_ERR_MPI_NOT_ACCEPTABLE |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 1276 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1277 | Base test mbedtls_mpi_is_prime #6 |
| 1278 | depends_on:MBEDTLS_GENPRIME |
| 1279 | mbedtls_mpi_is_prime:10:"5":0 |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 1280 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1281 | Base test mbedtls_mpi_is_prime #7 |
| 1282 | depends_on:MBEDTLS_GENPRIME |
| 1283 | mbedtls_mpi_is_prime:10:"27":MBEDTLS_ERR_MPI_NOT_ACCEPTABLE |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 1284 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1285 | Base test mbedtls_mpi_is_prime #8 |
| 1286 | depends_on:MBEDTLS_GENPRIME |
| 1287 | mbedtls_mpi_is_prime:10:"47":0 |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 1288 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1289 | Test mbedtls_mpi_is_prime #1a |
| 1290 | depends_on:MBEDTLS_GENPRIME |
| 1291 | mbedtls_mpi_is_prime:10:"83726728883146151979668243326097049289208482987685965276439157162337476477581":MBEDTLS_ERR_MPI_NOT_ACCEPTABLE |
Manuel Pégourié-Gonnard | 378fb4b | 2013-11-22 18:39:18 +0100 | [diff] [blame] | 1292 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1293 | Test mbedtls_mpi_is_prime #1b |
| 1294 | depends_on:MBEDTLS_GENPRIME |
| 1295 | mbedtls_mpi_is_prime:10:"81248637410584921454869308488899267096530643632730258201256092582281263244641":MBEDTLS_ERR_MPI_NOT_ACCEPTABLE |
Manuel Pégourié-Gonnard | 378fb4b | 2013-11-22 18:39:18 +0100 | [diff] [blame] | 1296 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1297 | Test mbedtls_mpi_is_prime #2a |
| 1298 | depends_on:MBEDTLS_GENPRIME |
| 1299 | mbedtls_mpi_is_prime:10:"827131507221654563937832686696200995595835694437983658840870036586124168186967796809117749047430768825822857042432722828096779098498192459819306321073968735177531164565305635281198148032612029767584644305912099":0 |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 1300 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1301 | Test mbedtls_mpi_is_prime #2b |
| 1302 | depends_on:MBEDTLS_GENPRIME |
| 1303 | mbedtls_mpi_is_prime:10:"827131507221654563937832686696200995595835694437983658840870036586124168186967796809117749047430768825822857042432722828096779098498192459819306321073968735177531164565305635281198148032612029767584644305912001":MBEDTLS_ERR_MPI_NOT_ACCEPTABLE |
Paul Bakker | e896fea | 2009-07-06 06:40:23 +0000 | [diff] [blame] | 1304 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1305 | Test mbedtls_mpi_is_prime #3 |
| 1306 | depends_on:MBEDTLS_GENPRIME |
| 1307 | mbedtls_mpi_is_prime:10:"2833419889721787128217599":0 |
Paul Bakker | ba48cb2 | 2009-07-12 11:01:32 +0000 | [diff] [blame] | 1308 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1309 | Test mbedtls_mpi_is_prime #4 |
| 1310 | depends_on:MBEDTLS_GENPRIME |
| 1311 | mbedtls_mpi_is_prime:10:"195845982777569926302400511":0 |
Paul Bakker | ba48cb2 | 2009-07-12 11:01:32 +0000 | [diff] [blame] | 1312 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1313 | Test mbedtls_mpi_is_prime #5 |
| 1314 | depends_on:MBEDTLS_GENPRIME |
| 1315 | mbedtls_mpi_is_prime:10:"4776913109852041418248056622882488319":0 |
Paul Bakker | ba48cb2 | 2009-07-12 11:01:32 +0000 | [diff] [blame] | 1316 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1317 | Test mbedtls_mpi_is_prime #5 |
| 1318 | depends_on:MBEDTLS_GENPRIME |
| 1319 | mbedtls_mpi_is_prime:10:"768614336404564651":0 |
Paul Bakker | ba48cb2 | 2009-07-12 11:01:32 +0000 | [diff] [blame] | 1320 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1321 | Test mbedtls_mpi_is_prime #6 |
| 1322 | depends_on:MBEDTLS_GENPRIME |
| 1323 | mbedtls_mpi_is_prime:10:"201487636602438195784363":0 |
Paul Bakker | ba48cb2 | 2009-07-12 11:01:32 +0000 | [diff] [blame] | 1324 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1325 | Test mbedtls_mpi_is_prime #7 |
| 1326 | depends_on:MBEDTLS_GENPRIME |
| 1327 | mbedtls_mpi_is_prime:10:"845100400152152934331135470251":0 |
Paul Bakker | ba48cb2 | 2009-07-12 11:01:32 +0000 | [diff] [blame] | 1328 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1329 | Test mbedtls_mpi_is_prime #8 |
| 1330 | depends_on:MBEDTLS_GENPRIME |
| 1331 | mbedtls_mpi_is_prime:10:"56713727820156410577229101238628035243":0 |
Paul Bakker | ba48cb2 | 2009-07-12 11:01:32 +0000 | [diff] [blame] | 1332 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1333 | Test mbedtls_mpi_is_prime #9 |
| 1334 | depends_on:MBEDTLS_GENPRIME |
| 1335 | mbedtls_mpi_is_prime:10:"203956878356401977405765866929034577280193993314348263094772646453283062722701277632936616063144088173312372882677123879538709400158306567338328279154499698366071906766440037074217117805690872792848149112022286332144876183376326512083574821647933992961249917319836219304274280243803104015000563790123":0 |
Paul Bakker | ba48cb2 | 2009-07-12 11:01:32 +0000 | [diff] [blame] | 1336 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1337 | Test mbedtls_mpi_is_prime #10 |
| 1338 | depends_on:MBEDTLS_GENPRIME |
| 1339 | mbedtls_mpi_is_prime:10:"531872289054204184185084734375133399408303613982130856645299464930952178606045848877129147820387996428175564228204785846141207532462936339834139412401975338705794646595487324365194792822189473092273993580587964571659678084484152603881094176995594813302284232006001752128168901293560051833646881436219":0 |
Paul Bakker | ba48cb2 | 2009-07-12 11:01:32 +0000 | [diff] [blame] | 1340 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1341 | Test mbedtls_mpi_is_prime #11 |
| 1342 | depends_on:MBEDTLS_GENPRIME |
| 1343 | mbedtls_mpi_is_prime:10:"319705304701141539155720137200974664666792526059405792539680974929469783512821793995613718943171723765238853752439032835985158829038528214925658918372196742089464683960239919950882355844766055365179937610326127675178857306260955550407044463370239890187189750909036833976197804646589380690779463976173":0 |
Paul Bakker | ba48cb2 | 2009-07-12 11:01:32 +0000 | [diff] [blame] | 1344 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1345 | Test mbedtls_mpi_is_prime #12 |
| 1346 | depends_on:MBEDTLS_GENPRIME |
| 1347 | mbedtls_mpi_is_prime:10:"200603822195324642393516294012917598972967449320074999667103434371470616000652036570009912021332527788252300901905236578801044680456930305350440933538867383130165841118050781326291059830545891570648243241795871":0 |
Paul Bakker | ba48cb2 | 2009-07-12 11:01:32 +0000 | [diff] [blame] | 1348 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1349 | Test mbedtls_mpi_is_prime #13 |
| 1350 | depends_on:MBEDTLS_GENPRIME |
| 1351 | mbedtls_mpi_is_prime:10:"827131507221654563937832686696200995595835694437983658840870036586124168186967796809117749047430768825822857042432722828096779098498192459819306321073968735177531164565305635281198148032612029767584644305912099":0 |
Paul Bakker | ba48cb2 | 2009-07-12 11:01:32 +0000 | [diff] [blame] | 1352 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1353 | Test mbedtls_mpi_is_prime #14 |
| 1354 | depends_on:MBEDTLS_GENPRIME |
| 1355 | mbedtls_mpi_is_prime:10:"964274047248418797145090983157197980855078966882276492572788532954904112655338439361306213898569516593744267391754033306465125919199692703323878557833023573312685002670662846477592597659826113460619815244721311":0 |
Paul Bakker | ba48cb2 | 2009-07-12 11:01:32 +0000 | [diff] [blame] | 1356 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1357 | Test mbedtls_mpi_is_prime #15 |
| 1358 | depends_on:MBEDTLS_GENPRIME |
| 1359 | mbedtls_mpi_is_prime:10:"170141183460469231731687303715884105727":0 |
Paul Bakker | ba48cb2 | 2009-07-12 11:01:32 +0000 | [diff] [blame] | 1360 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1361 | Test mbedtls_mpi_is_prime #16 |
| 1362 | depends_on:MBEDTLS_GENPRIME |
| 1363 | mbedtls_mpi_is_prime:10:"2147483647":0 |
Paul Bakker | ba48cb2 | 2009-07-12 11:01:32 +0000 | [diff] [blame] | 1364 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1365 | Test mbedtls_mpi_is_prime #17 |
| 1366 | depends_on:MBEDTLS_GENPRIME |
| 1367 | mbedtls_mpi_is_prime:10:"961748941":0 |
Paul Bakker | ba48cb2 | 2009-07-12 11:01:32 +0000 | [diff] [blame] | 1368 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1369 | Test mbedtls_mpi_is_prime #18 |
| 1370 | depends_on:MBEDTLS_GENPRIME |
| 1371 | mbedtls_mpi_is_prime:10:"179424691":0 |
Paul Bakker | ba48cb2 | 2009-07-12 11:01:32 +0000 | [diff] [blame] | 1372 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1373 | Test mbedtls_mpi_is_prime #19 |
| 1374 | depends_on:MBEDTLS_GENPRIME |
| 1375 | mbedtls_mpi_is_prime:10:"32452867":0 |
Paul Bakker | ba48cb2 | 2009-07-12 11:01:32 +0000 | [diff] [blame] | 1376 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1377 | Test mbedtls_mpi_is_prime #20 |
| 1378 | depends_on:MBEDTLS_GENPRIME |
| 1379 | mbedtls_mpi_is_prime:10:"49979687":0 |
Paul Bakker | ba48cb2 | 2009-07-12 11:01:32 +0000 | [diff] [blame] | 1380 | |
Janos Follath | 64eca05 | 2018-09-05 17:04:49 +0100 | [diff] [blame] | 1381 | Test mbedtls_mpi_is_prime_det (4 non-witnesses) |
| 1382 | depends_on:MBEDTLS_GENPRIME |
Darryl Green | ac2ead0 | 2018-10-02 15:30:39 +0100 | [diff] [blame] | 1383 | mbedtls_mpi_is_prime_det:"043BD64BA10B11DA83FBD296B04BCA9E0552FAF6E09CAC74E2D7E735ED0DB09FC47ED76145644203EE0C826013BC602F560BCDAAED557D04683859A65D659FF828A245A2C5B1AC41E01E4669A525A45E23AF":"040EA852F7935ACCECC0E87B845281F047D10DC9AAFEF990AF9D3D66770DA30B0C5B5E03EEA8C0CB79B936FE0BB8EE5389EC1D34EB16C58AA3F2E11AF084160CDF6400BE1CC179867AB074866952D9F34EE7042D27F960E715A97FCB93F3182247D0A6AE51BD21CC2F6B0651F9E572C5FB86F3137053FA85FD7A51816D69B3A53A5A438C17754836D04E98CA240B901F828332F2D72D88C497DA45F533F99A6E53EDEA6B0424EC8951B048FA9A80134B37D0A67014597934E3CFC52C5A4DD4751ADF8D66FC79E84E2A3148C4B15C17E12CB659390FD275F39A331FFC80EC699BC3F6FAB868E30E9B14575FCDAB6FAED01E00112DD28704177E09C335AD43A696FEA761E8DF3B0663277A5C3637F9060CB5E5654F72E9A6B0F369E660AD4CF7ABF4195493545B367BD55271CD4BB7D9C15D3F508FE8F7409C2126FC8E73B43A67CD4EFB21E9F15DBF040A2A8D5F5ED75CEAC12B595C0051F3EC9D5A58ACE82A9506E64F780E9836728260FFE1BFD73E8A9869E3D46A35A856D3028F7FEAB9F4F1A04449AEDC80017EE1014080D87F0B50C8EF255324CD89F7D039":82:5 |
Janos Follath | 64eca05 | 2018-09-05 17:04:49 +0100 | [diff] [blame] | 1384 | |
| 1385 | Test mbedtls_mpi_is_prime_det (39 non-witnesses) |
| 1386 | depends_on:MBEDTLS_GENPRIME |
Darryl Green | ac2ead0 | 2018-10-02 15:30:39 +0100 | [diff] [blame] | 1387 | mbedtls_mpi_is_prime_det:"155102B67930FBE8858DF6C0642D77D419A7B7968E622CC7500F3E3F2C5168368C50E0083187":"119B3E2C721834D83416239B04447AA18AE0163E61DCAE97054563D79E094A6FA4485BD6A0501445BF57FE9C058926CDB862E04CC1A95D79D61D9AB3466857A53E04F8D7470C9C86649B226A13DDC534E18DFD5C22FAEA317CA4D4960F18457FD6D2FFB5F3273F74C89980DC774590D8D30D1159CA81999ED94A042D67DA68C82616AD46C2C88288A8EBD0B37AC7C152D9522CA4544642AD1210F6B642FEBF43563FA872B0DEFAFC69D0B6570E8FEA9570D0AADCFA9B06CC8BFD62CEDC221541210EEEF9762448C6D49F26AA767A4D66CB168589E0201923015314E6CD4A480E5936E7CF145F73A564C5B782635B3AFC3028E2632C5D3458224A7C9E8BA1876E8F690463C878292D3DC011E9640331E7F7621F2B5E0F6713DD8C9D6767521C4BA880DA8D11C67753C8493D2C4C4F1443147550D0B25B7FAD04EAFA9F8AA60974C1365C8A794CFEECEB4279B1150909A97E5A7A10B5D91186CA5B25A612036631FE73529C8CFAE51E76FB704A772DE5320EFC1212E7A399B1FEBF57D014AF9129DFF5D2C5DFBBEEAC55F360CF6D22FA90B8E2E9AD0C71AB6495A9452A58D653B8CC26128C66B43EFBA6E39AEC5717A1A3C2AE1449FCABAFE1180B159DA55190CD81A3D9E8D798647E11B827F0A057D6DA5AAD78AB5112EE65E10E8B8B369BA24E1B8AD2CD8548C497016C07A143DE1232F8059BE303572456FA92E76A0F23D1340629228B7D27C02D3833A72745B91A3DBEB5E081117A9F19597F00E4277B414FAEA8C8CEB895C37F956A5A22F8D7A10ADA50B22BAB312504904511AA0EFDD4D3BF20ECB17E8A684564FFB5BBD5E22C429F9A75A4FB4AE468FE7612ED53C7A11212E7EF3435CC9CA6E7DB167B8CCE2BECF35F89013F8F876223C77FA81570970858663C6E32B91080AA47F9C90177F51E6FD7747B910C9489C7B6ACB070996198AD9A40A69711274159210A9A12DBAAA4FB4632446066AB70D735DC95F7C2BCE517E88C064D728DE82B1B043DF4AEE0EFF5131120A4E5B9B4180EB6F6B8A0D1491ABDA069058A9966B1A517D8E7B4997DC52A1E698FD79E271153DF1913FE6787A5D99DE69F39C3F22D26DC731CFBB33FF5C267D85D7A3DAE8E1C87E1DB2F1236212EF1942EA756967FB3D07D629E59EA4034D9A9B5E270DD4A31C8A3DFDA99C1094B5537132C196DA2AEAF5253A019B9AF25B5DCB0D4DD75C7C9C353DA9DAABFB23959A5455312E7E1C21268C1BC14E83DCFDF50C27FD3E8B4EDC04C5F3CB5FCFFF2B57151E1B1EE1A6456DC006BC43E1158674AA4CF7D146DE4A57103BE43ED130C8007294ED2418C7A2B769A7D20EBB5A8367A77B313F81BB119B9954305FF160FF83EED7F808EE6D340A5CCC000CF81AA497D315D350CCE4E86A31456B8AA85B677491FC662933DFA55EB5BFF64B8D85430D676A85D1CAFAFF383E68C4E6C22A51063739EC03FC58C36C07C44E54828BE2152B2E9AFB0F179B157D09B64C147B524BB5424BB1914419424D9100D06EDCFC718F4DF3D562E9E16C446663F35273CA7BC5426B868A80C8D415C9A12A1619CDB7CDB5BEBC70313150BDF8C3AB26B809FE62D28E798EF1EF98C410A2DA0A9071F82154AC569078B0E647E2C085D1D907E634453442803D0492D3D0C78CACB762020C0E589C8B0981321EA2771305FD0413F3B2963FCE9A232F6641DB7E12ADC009A032063C41756E5E19E5711DE12711F07AFE7545B4D83F3EFD7BFD0435297C89DF3D4AF96EBE2CE8D64B93E36EA5D7E5A0492151D0CAEE7449A7D35E1A3C83E22C3B35162C073CC3B1CF76FBDEE84270721FC042EAAEB7325110181415E2031CFB7462F15111291CDAC0560FF9F4C7341F2FA261B97CEF348D074AA2EB4DB153FE6B1410519DA4213B611999868F3B867A2B6D758D333C4989DE80782683CA26ECDE373C71524F01B76349CE8A07A5EBECBB42259CF970DDA756EC996B189FEA045FEE45F23D476960913106ECA2510B8517AA75D56FA4152B2BDDC212014E5D07FD964D6EE532F0616DF74E104659955132331FABF2D2AD265E71C93C648A956FA0A3DB21FF103D516527F2DA0E870340B61EE8A8ED913B60605EB5A67B834D0FC90564386012585609870FEF6530B3E3C037B55506F0B5694F6B0FC":38:40 |
Janos Follath | 64eca05 | 2018-09-05 17:04:49 +0100 | [diff] [blame] | 1388 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1389 | Test mbedtls_mpi_gen_prime (Too small) |
| 1390 | depends_on:MBEDTLS_GENPRIME |
| 1391 | mbedtls_mpi_gen_prime:2:0:MBEDTLS_ERR_MPI_BAD_INPUT_DATA |
Manuel Pégourié-Gonnard | 15f58a8 | 2014-06-16 17:12:40 +0200 | [diff] [blame] | 1392 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1393 | Test mbedtls_mpi_gen_prime (OK, minimum size) |
| 1394 | depends_on:MBEDTLS_GENPRIME |
| 1395 | mbedtls_mpi_gen_prime:3:0:0 |
Manuel Pégourié-Gonnard | 15f58a8 | 2014-06-16 17:12:40 +0200 | [diff] [blame] | 1396 | |
Jethro Beekman | 6668927 | 2018-02-14 19:24:10 -0800 | [diff] [blame] | 1397 | Test mbedtls_mpi_gen_prime (corner case limb size -1 bits) |
| 1398 | depends_on:MBEDTLS_GENPRIME |
| 1399 | mbedtls_mpi_gen_prime:63:0:0 |
| 1400 | |
| 1401 | Test mbedtls_mpi_gen_prime (corner case limb size) |
| 1402 | depends_on:MBEDTLS_GENPRIME |
| 1403 | mbedtls_mpi_gen_prime:64:0:0 |
| 1404 | |
| 1405 | Test mbedtls_mpi_gen_prime (corner case limb size +1 bits) |
| 1406 | depends_on:MBEDTLS_GENPRIME |
| 1407 | mbedtls_mpi_gen_prime:65:0:0 |
| 1408 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1409 | Test mbedtls_mpi_gen_prime (Larger) |
| 1410 | depends_on:MBEDTLS_GENPRIME |
| 1411 | mbedtls_mpi_gen_prime:128:0:0 |
Manuel Pégourié-Gonnard | 15f58a8 | 2014-06-16 17:12:40 +0200 | [diff] [blame] | 1412 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1413 | Test mbedtls_mpi_gen_prime (Safe) |
| 1414 | depends_on:MBEDTLS_GENPRIME |
Janos Follath | 7c025a9 | 2018-08-14 11:08:41 +0100 | [diff] [blame] | 1415 | mbedtls_mpi_gen_prime:128:MBEDTLS_MPI_GEN_PRIME_FLAG_DH:0 |
Manuel Pégourié-Gonnard | 15f58a8 | 2014-06-16 17:12:40 +0200 | [diff] [blame] | 1416 | |
Janos Follath | a3cb7eb | 2018-08-14 15:31:54 +0100 | [diff] [blame] | 1417 | Test mbedtls_mpi_gen_prime (Safe with lower error rate) |
| 1418 | depends_on:MBEDTLS_GENPRIME |
| 1419 | mbedtls_mpi_gen_prime:128:MBEDTLS_MPI_GEN_PRIME_FLAG_DH | MBEDTLS_MPI_GEN_PRIME_FLAG_LOW_ERR:0 |
| 1420 | |
| 1421 | Test mbedtls_mpi_gen_prime standard RSA #1 (lower error rate) |
| 1422 | depends_on:MBEDTLS_GENPRIME |
| 1423 | mbedtls_mpi_gen_prime:1024:MBEDTLS_MPI_GEN_PRIME_FLAG_LOW_ERR:0 |
| 1424 | |
| 1425 | Test mbedtls_mpi_gen_prime standard RSA #2 (lower error rate) |
| 1426 | depends_on:MBEDTLS_GENPRIME |
| 1427 | mbedtls_mpi_gen_prime:1536:MBEDTLS_MPI_GEN_PRIME_FLAG_LOW_ERR:0 |
| 1428 | |
Paul Bakker | 2f5947e | 2011-05-18 15:47:11 +0000 | [diff] [blame] | 1429 | Test bit getting (Value bit 25) |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1430 | mbedtls_mpi_get_bit:10:"49979687":25:1 |
Paul Bakker | 2f5947e | 2011-05-18 15:47:11 +0000 | [diff] [blame] | 1431 | |
| 1432 | Test bit getting (Larger but same limb) |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1433 | mbedtls_mpi_get_bit:10:"49979687":26:0 |
Paul Bakker | 2f5947e | 2011-05-18 15:47:11 +0000 | [diff] [blame] | 1434 | |
| 1435 | Test bit getting (Larger and non-existing limb) |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1436 | mbedtls_mpi_get_bit:10:"49979687":500:0 |
Paul Bakker | 2f5947e | 2011-05-18 15:47:11 +0000 | [diff] [blame] | 1437 | |
Gilles Peskine | bc781ea | 2021-06-08 23:01:13 +0200 | [diff] [blame] | 1438 | Test bit getting in 0 (null) |
| 1439 | mbedtls_mpi_get_bit:10:"":500:0 |
| 1440 | |
Paul Bakker | 2f5947e | 2011-05-18 15:47:11 +0000 | [diff] [blame] | 1441 | Test bit getting (Value bit 24) |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1442 | mbedtls_mpi_get_bit:10:"49979687":24:0 |
Paul Bakker | 2f5947e | 2011-05-18 15:47:11 +0000 | [diff] [blame] | 1443 | |
| 1444 | Test bit getting (Value bit 23) |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1445 | mbedtls_mpi_get_bit:10:"49979687":23:1 |
Paul Bakker | 2f5947e | 2011-05-18 15:47:11 +0000 | [diff] [blame] | 1446 | |
| 1447 | Test bit set (Change existing value with a 1) |
Paul Bakker | ec5ceb6 | 2016-07-14 12:47:07 +0100 | [diff] [blame] | 1448 | mbedtls_mpi_set_bit:10:"49979687":24:1:10:"66756903":0 |
Paul Bakker | 2f5947e | 2011-05-18 15:47:11 +0000 | [diff] [blame] | 1449 | |
| 1450 | Test bit set (Change existing value with a 0) |
Paul Bakker | ec5ceb6 | 2016-07-14 12:47:07 +0100 | [diff] [blame] | 1451 | mbedtls_mpi_set_bit:10:"49979687":25:0:10:"16425255":0 |
Paul Bakker | 2f5947e | 2011-05-18 15:47:11 +0000 | [diff] [blame] | 1452 | |
| 1453 | Test bit set (Add above existing limbs with a 0) |
Paul Bakker | ec5ceb6 | 2016-07-14 12:47:07 +0100 | [diff] [blame] | 1454 | mbedtls_mpi_set_bit:10:"49979687":80:0:10:"49979687":0 |
Paul Bakker | 2f5947e | 2011-05-18 15:47:11 +0000 | [diff] [blame] | 1455 | |
| 1456 | Test bit set (Add above existing limbs with a 1) |
Paul Bakker | ec5ceb6 | 2016-07-14 12:47:07 +0100 | [diff] [blame] | 1457 | mbedtls_mpi_set_bit:10:"49979687":80:1:10:"1208925819614629224685863":0 |
Paul Bakker | 2f5947e | 2011-05-18 15:47:11 +0000 | [diff] [blame] | 1458 | |
Gilles Peskine | bc781ea | 2021-06-08 23:01:13 +0200 | [diff] [blame] | 1459 | Test bit set (Add to 0 (null) with a 0) |
| 1460 | mbedtls_mpi_set_bit:16:"":65:0:16:"":0 |
| 1461 | |
| 1462 | Test bit set (Add to 0 (null) with a 1) |
| 1463 | mbedtls_mpi_set_bit:16:"":65:1:16:"020000000000000000":0 |
| 1464 | |
Manuel Pégourié-Gonnard | 9a4a5ac | 2013-12-04 18:05:29 +0100 | [diff] [blame] | 1465 | Test bit set (Bit index larger than 31 with a 0) |
Paul Bakker | ec5ceb6 | 2016-07-14 12:47:07 +0100 | [diff] [blame] | 1466 | mbedtls_mpi_set_bit:16:"FFFFFFFFFFFFFFFF":32:0:16:"FFFFFFFEFFFFFFFF":0 |
Manuel Pégourié-Gonnard | 9a4a5ac | 2013-12-04 18:05:29 +0100 | [diff] [blame] | 1467 | |
| 1468 | Test bit set (Bit index larger than 31 with a 1) |
Paul Bakker | ec5ceb6 | 2016-07-14 12:47:07 +0100 | [diff] [blame] | 1469 | mbedtls_mpi_set_bit:16:"00":32:1:16:"0100000000":0 |
| 1470 | |
| 1471 | Test bit set (Invalid bit value) |
| 1472 | mbedtls_mpi_set_bit:16:"00":5:2:16:"00":MBEDTLS_ERR_MPI_BAD_INPUT_DATA |
Manuel Pégourié-Gonnard | 9a4a5ac | 2013-12-04 18:05:29 +0100 | [diff] [blame] | 1473 | |
Gilles Peskine | 2f78062 | 2020-11-25 15:37:20 +0100 | [diff] [blame] | 1474 | Fill random: 0 bytes |
| 1475 | mpi_fill_random:0:0:0 |
| 1476 | |
| 1477 | Fill random: 1 byte, good |
| 1478 | mpi_fill_random:1:1:0 |
| 1479 | |
| 1480 | Fill random: 2 bytes, good, no leading zero |
| 1481 | mpi_fill_random:2:2:0 |
| 1482 | |
| 1483 | Fill random: 2 bytes, good, 1 leading zero |
| 1484 | mpi_fill_random:2:256:0 |
| 1485 | |
| 1486 | Fill random: MAX_SIZE - 7, good |
| 1487 | mpi_fill_random:MBEDTLS_MPI_MAX_SIZE - 7:MBEDTLS_MPI_MAX_SIZE - 7:0 |
| 1488 | |
| 1489 | Fill random: MAX_SIZE, good |
| 1490 | mpi_fill_random:MBEDTLS_MPI_MAX_SIZE:MBEDTLS_MPI_MAX_SIZE:0 |
| 1491 | |
| 1492 | Fill random: 1 byte, RNG failure |
| 1493 | mpi_fill_random:1:0:MBEDTLS_ERR_ENTROPY_SOURCE_FAILED |
| 1494 | |
| 1495 | Fill random: 2 bytes, RNG failure after 1 byte |
| 1496 | mpi_fill_random:2:1:MBEDTLS_ERR_ENTROPY_SOURCE_FAILED |
| 1497 | |
| 1498 | Fill random: 4 bytes, RNG failure after 3 bytes |
| 1499 | mpi_fill_random:4:3:MBEDTLS_ERR_ENTROPY_SOURCE_FAILED |
| 1500 | |
| 1501 | Fill random: 8 bytes, RNG failure after 7 bytes |
| 1502 | mpi_fill_random:8:7:MBEDTLS_ERR_ENTROPY_SOURCE_FAILED |
| 1503 | |
| 1504 | Fill random: 16 bytes, RNG failure after 1 bytes |
| 1505 | mpi_fill_random:16:1:MBEDTLS_ERR_ENTROPY_SOURCE_FAILED |
| 1506 | |
| 1507 | Fill random: 16 bytes, RNG failure after 8 bytes |
| 1508 | mpi_fill_random:16:8:MBEDTLS_ERR_ENTROPY_SOURCE_FAILED |
| 1509 | |
| 1510 | Fill random: 16 bytes, RNG failure after 15 bytes |
| 1511 | mpi_fill_random:16:15:MBEDTLS_ERR_ENTROPY_SOURCE_FAILED |
| 1512 | |
| 1513 | Fill random: MAX_SIZE bytes, RNG failure after MAX_SIZE-1 bytes |
| 1514 | mpi_fill_random:MBEDTLS_MPI_MAX_SIZE:MBEDTLS_MPI_MAX_SIZE-1:MBEDTLS_ERR_ENTROPY_SOURCE_FAILED |
| 1515 | |
Paul Bakker | e896fea | 2009-07-06 06:40:23 +0000 | [diff] [blame] | 1516 | MPI Selftest |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1517 | depends_on:MBEDTLS_SELF_TEST |
Paul Bakker | e896fea | 2009-07-06 06:40:23 +0000 | [diff] [blame] | 1518 | mpi_selftest: |