David Horstmann
38e4e9c499
Add explicit UNPOISON calls to memory tests
...
These are needed to allow them to operate on buffer copies without
triggering ASan use-after-poison detection.
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-12-11 17:58:56 +00:00
David Horstmann
89875a4f20
Rename "output_copy" -> "local_output"
...
This helps to prevent confusion as it avoids overloading the word
"copy" as both an action and an object.
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-11-20 17:55:13 +00:00
David Horstmann
f1734054fa
Rename "input_copy" -> "local_input"
...
This helps to prevent confusion as it avoids overloading the word
"copy" as both an action and an object.
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-11-20 17:54:57 +00:00
David Horstmann
2f307b4216
De-abbreviate "len" -> "length"
...
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-11-20 13:04:06 +00:00
David Horstmann
9abf535078
Add initializers for input / output copies
...
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-11-20 12:29:54 +00:00
David Horstmann
365df3f16c
Remove unnecessary checks for NULL-ness of copies
...
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-11-16 20:30:36 +00:00
David Horstmann
58909704e3
Check for len == 0 rather than buffer == NULL
...
This makes the intention clearer
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-11-16 20:26:16 +00:00
David Horstmann
0fca150b81
Compare buffers even for zero-length cases
...
This enables us to test that lengths are correctly zero when the buffer
pointer is NULL.
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-11-16 20:12:17 +00:00
David Horstmann
23f1122838
Use TEST_CALLOC_NONNULL
...
Check that input/output copying works for zero-length NULL input
buffers.
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-11-16 20:01:32 +00:00
David Horstmann
b4e3f36918
Change data pattern to simpler one
...
Just use the index modulo 256, as this has a greater stride and is
simpler to use.
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-11-16 19:57:25 +00:00
David Horstmann
1b7279a849
Make copy functions static-testable
...
This allows greater compiler optimisation.
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-11-15 17:26:18 +00:00
David Horstmann
0a57ed25c4
Add output round-trip testcase
...
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-11-08 18:18:14 +00:00
David Horstmann
35dd103688
Add input round-trip testcase
...
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-11-08 18:17:58 +00:00
David Horstmann
63a73588cf
Add testcase for psa_crypto_output_copy_free()
...
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-11-08 18:13:23 +00:00
David Horstmann
70b82256b5
Add testcase for psa_crypto_output_copy_alloc()
...
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-11-08 18:13:23 +00:00
David Horstmann
4700144817
Add testcase for psa_crypto_input_copy_free()
...
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-11-08 18:13:15 +00:00
David Horstmann
1ac7e24fb7
Add testcase for psa_crypto_input_copy_alloc()
...
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-11-07 16:36:41 +00:00
David Horstmann
b3de69493c
Remove psa_crypto_alloc_and_copy() API
...
This tied input and output buffers together in
awkward pairs, which made the API more difficult
to use.
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-11-06 17:45:09 +00:00
David Horstmann
ad33ab376b
Move buffer copy tests into new testsuite
...
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-11-03 20:01:37 +00:00