Gilles Peskine
90ec8e857c
Overhaul testing of mbedtls_mpi_copy
...
Replace the two test functions mbedtls_mpi_copy_sint (supporting signed
inputs but always with exactly one limb) and mbedtls_mpi_copy_binary
(supporting arbitrary-sized inputs but not negative inputs) by a single
function that supports both arbitrary-sized inputs and arbitrary-signed
inputs. This will allows testing combinations like negative source and
zero-sized destination.
Also generalize mpi_copy_self to support arbitrary inputs.
Generate a new list of test cases systematically enumerating all
possibilities among various categories: zero with 0 or 1 limb, negative or
positive with 1 limb, negative or positive with >1 limb. I used the
following Perl script:
```
sub rhs { $_ = $_[0]; s/bead/beef/; s/ca5cadedb01dfaceacc01ade/face1e55ca11ab1ecab005e5/; $_ }
%v = (
"zero (null)" => "",
"zero (1 limb)" => "0",
"small positive" => "bead",
"large positive" => "ca5cadedb01dfaceacc01ade",
"small negative" => "-bead",
"large negative" => "-ca5cadedb01dfaceacc01ade",
);
foreach $s (sort keys %v) {
foreach $d (sort keys %v) {
printf "Copy %s to %s\nmbedtls_mpi_copy:\"%s\":\"%s\"\n\n",
$s, $d, $v{$s}, rhs($v{$d});
}
}
foreach $s (sort keys %v) {
printf "Copy self: %s\nmpi_copy_self:\"%s\"\n\n", $s, $v{$s};
}
```
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2021-06-22 12:44:05 +02:00
..
2021-06-14 16:17:32 +02:00
2021-05-18 16:43:43 +02:00
2021-06-14 16:17:32 +02:00
2021-02-03 12:07:01 +00:00
2019-08-15 15:44:50 +01:00
2019-08-15 15:44:50 +01:00
2019-08-15 15:44:50 +01:00
2021-06-21 09:10:55 +01:00
2019-08-15 15:44:50 +01:00
2021-05-27 17:27:14 +02:00
2019-08-15 15:44:50 +01:00
2021-05-27 17:35:04 +02:00
2021-05-28 12:56:57 +02:00
2020-02-05 15:40:22 +00:00
2021-06-22 12:44:05 +02:00
2019-10-31 19:17:36 +02:00
2021-04-07 16:31:09 +01:00
2021-03-04 14:23:03 +00:00
2021-03-02 22:48:40 +00:00
2021-05-27 17:35:04 +02:00
2021-05-27 17:35:04 +02:00
2021-06-21 13:27:29 +02:00
2021-05-27 17:35:04 +02:00
2021-05-27 17:27:14 +02:00
2021-05-27 17:27:14 +02:00
2021-05-27 17:27:14 +02:00
2021-05-27 17:27:14 +02:00
2020-03-24 13:18:58 -04:00
2019-07-29 17:46:29 +02:00
2020-03-24 13:18:58 -04:00
2019-08-15 15:44:50 +01:00
2019-08-15 15:44:50 +01:00
2019-08-15 15:44:50 +01:00
2019-09-20 15:59:31 +02:00
2021-05-27 17:36:54 +02:00
2020-06-26 22:40:58 +02:00
2019-08-15 15:44:50 +01:00
2019-09-20 16:01:59 +02:00
2019-09-20 15:59:31 +02:00
2021-06-16 10:34:25 +02:00
2019-08-15 15:44:50 +01:00
2019-08-15 15:44:50 +01:00
2019-11-21 13:49:20 +01:00
2021-06-08 16:45:41 +02:00
2021-06-17 21:46:29 +02:00
2021-06-22 12:44:05 +02:00
2019-08-15 15:44:50 +01:00
2020-07-01 17:10:15 +02:00
2021-06-07 15:41:49 +02:00
2021-06-22 12:44:05 +02:00
2021-06-07 15:41:49 +02:00
2021-06-22 12:44:05 +02:00
2021-05-27 17:27:14 +02:00
2021-06-22 12:44:05 +02:00
2021-03-17 11:36:31 +01:00
2021-05-27 17:34:14 +02:00
2021-06-07 15:41:49 +02:00
2021-06-22 12:44:05 +02:00
2021-05-11 13:15:19 +02:00
2021-04-07 16:31:09 +01:00
2015-04-08 13:25:31 +02:00
2018-08-06 11:40:57 +01:00
2019-09-20 15:59:31 +02:00
2019-09-20 15:59:31 +02:00
2019-09-20 15:59:31 +02:00
2019-09-20 15:59:31 +02:00
2019-09-20 15:59:31 +02:00
2019-09-20 15:59:31 +02:00
2019-08-15 15:44:50 +01:00
2021-05-27 17:35:04 +02:00
2021-05-27 17:35:04 +02:00
2021-06-16 10:34:45 +02:00
2021-03-10 12:52:37 +00:00
2020-11-25 14:25:56 -08:00
2021-05-10 13:51:53 +02:00
2021-05-10 13:51:53 +02:00
2021-04-28 14:38:37 +02:00
2021-04-28 14:38:37 +02:00
2021-06-16 10:34:25 +02:00
2020-07-01 17:10:15 +02:00
2021-06-16 10:34:25 +02:00
2021-06-16 10:34:25 +02:00
2019-10-31 15:07:35 +01:00
2019-10-31 15:07:45 +01:00
2021-06-22 12:44:05 +02:00
2021-06-22 12:44:05 +02:00
2021-03-29 14:20:18 +01:00
2021-03-29 14:20:18 +01:00
2021-02-25 15:56:48 +01:00
2021-03-01 11:43:56 +01:00
2021-06-21 13:27:29 +02:00
2020-06-26 10:45:16 +02:00
2021-05-10 13:51:53 +02:00
2021-04-27 17:18:52 +01:00
2019-08-15 15:44:50 +01:00
2019-08-15 15:44:50 +01:00
2021-05-27 17:27:14 +02:00
2021-06-22 12:44:05 +02:00
2021-05-12 15:18:20 +01:00
2021-06-22 12:44:05 +02:00
2021-04-28 14:38:37 +02:00
2021-06-08 14:11:19 +02:00
2021-04-28 14:38:37 +02:00
2020-06-12 14:33:08 +02:00
2021-06-18 12:59:38 +02:00
2021-06-17 09:38:38 +02:00
2019-11-05 15:32:53 +01:00
2021-06-17 09:38:38 +02:00
2021-05-27 17:27:14 +02:00
2021-05-27 17:27:14 +02:00
2021-03-24 09:26:44 +01:00
2021-02-01 13:17:23 +01:00
2021-05-13 11:18:58 +02:00
2021-06-21 09:19:22 +02:00
2021-03-10 13:19:45 -07:00
2021-04-19 10:55:21 +02:00
2021-06-16 10:34:25 +02:00
2021-01-06 18:21:18 +01:00
2019-10-23 19:47:05 +02:00
2021-06-15 15:47:44 +02:00
2021-06-16 10:34:25 +02:00
2021-06-03 12:07:47 +01:00
2021-02-17 14:58:29 +01:00
2021-02-17 14:50:17 +01:00
2021-04-01 14:54:50 +02:00
2021-01-06 18:21:18 +01:00
2020-05-11 11:15:26 +02:00
2021-01-06 18:21:18 +01:00
2021-04-01 14:54:50 +02:00
2021-02-23 20:36:07 +01:00
2021-04-06 18:46:30 +02:00
2021-03-17 16:11:05 +00:00
2021-05-25 20:12:00 +02:00
2021-03-10 23:22:35 +01:00
2021-06-22 09:27:41 +02:00
2021-06-22 12:18:25 +02:00
2020-11-26 15:54:35 +01:00
2021-03-10 17:00:32 +00:00
2021-02-16 15:46:06 +01:00
2021-05-11 13:15:19 +02:00
2021-06-18 12:59:38 +02:00
2021-06-22 12:44:05 +02:00
2021-05-27 17:35:04 +02:00
2021-06-08 16:45:41 +02:00
2021-06-16 10:34:25 +02:00
2021-06-22 11:53:10 +02:00
2021-06-15 15:47:44 +02:00
2021-06-15 15:47:44 +02:00
2021-03-09 16:09:18 +00:00
2020-04-22 16:01:48 +02:00
2021-06-18 12:59:38 +02:00
2021-06-07 13:52:23 +02:00
2021-06-16 10:34:25 +02:00
2021-06-22 12:44:05 +02:00