Add value_barriers in constant time select functions
authorBernd Edlinger <bernd.edlinger@hotmail.de>
Fri, 21 Jun 2019 19:26:19 +0000 (21:26 +0200)
committerBernd Edlinger <bernd.edlinger@hotmail.de>
Thu, 18 Jul 2019 13:55:19 +0000 (15:55 +0200)
commit04edd688b3727835f9b2c7cca7e4c963bf3ed2ba
treedac94a52fb60ce50e165e611fed42acdbb382b2e
parent05f4eb2dc983d45bface421e19913ccdfd3f9a9f
Add value_barriers in constant time select functions

The barriers prevent the compiler from narrowing down the
possible value range of the mask and ~mask in the select
statements, which avoids the recognition of the select
and turning it into a conditional load or branch.

Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
Reviewed-by: Kurt Roeckx <kurt@roeckx.be>
(Merged from https://github.com/openssl/openssl/pull/9217)
include/internal/constant_time_locl.h