mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-04-15 23:42:41 +00:00
Simplify mbedtls_ct_memcmp_partial test
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
This commit is contained in:
parent
2c9f86b3b6
commit
6568f60358
@ -283,10 +283,10 @@ void mbedtls_ct_memcmp_partial(int diff, int size, int skip_head, int skip_tail)
|
||||
/* Construct data that matches, except for specified byte (if in range). */
|
||||
for (int i = 0; i < size; i++) {
|
||||
a[i] = i & 0xff;
|
||||
if (i != diff) {
|
||||
b[i] = a[i];
|
||||
} else {
|
||||
b[i] = (i + 1) & 0xff;
|
||||
b[i] = a[i];
|
||||
if (i == diff) {
|
||||
// modify the specified byte
|
||||
b[i] ^= 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user