Home GnuPG

mpi: Fix mpi_set_cond and mpi_swap_cond .
8ad682c41204Unpublished

Unpublished Commit · Learn More

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

Description

mpi: Fix mpi_set_cond and mpi_swap_cond .

* mpi/mpiutil.c (_gcry_mpi_set_cond, _gcry_mpi_swap_cond): Don't use
the operator of !!, but assume SET/SWAP is 0 or 1.

If the code for !! would include a branch, it spoils the purpose of
mpi_set_cond/mpi_swap_cond at all. It's better to make sure the use
of this function to be called with 0 or 1 for SET/SWAP. Note that it
conforms when SET/SWAP is the result of conditional expression of
mpi_test_bit.

  • Reported-by: Taylor R Campbell.

Details

Provenance
gniibeAuthored on Nov 25 2015, 2:52 AM
Parents
rC295b1c354075: ecc: multiplication of Edwards curve to be constant-time.
Branches
Unknown
Tags
Unknown

Event Timeline

NIIBE Yutaka <gniibe@fsij.org> committed rC8ad682c41204: mpi: Fix mpi_set_cond and mpi_swap_cond . (authored by NIIBE Yutaka <gniibe@fsij.org>).Nov 25 2015, 3:35 AM