Home GnuPG

const-time: Add ct_memmov_cond, fix _gcry_mpih_set_cond.
45945be8f3c3Unpublished

Unpublished Commit · Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.

Description

const-time: Add ct_memmov_cond, fix _gcry_mpih_set_cond.

* src/const-time.c (ct_memmov_cond): New.
* src/const-time.h (ct_memmov_cond): New.
* mpi/mpih-const-time.c (_gcry_mpih_set_cond): Use XOR and a MASK.

Cherry-pick master commit of:
bd08357436a9559766cd458d25781ee4f94012a2

ct_memmov_cond is like memcpy, but it allows use with overlapping
memory area when DST <= SRC. It's not like memmove because it doesn't
allow overlapping memory area when DST > SRC.

  • Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>

Details

Provenance
gniibeAuthored on Oct 31 2023, 5:43 AM
Parents
rCe8072d8d3255: const-time: Use ct_not_memequal, instead. Tested with AVR.
Branches
Unknown
Tags
Unknown

Event Timeline