Left shift of a negative number is undefined behaviour
authorMatt Caswell <matt@openssl.org>
Thu, 1 Jun 2017 15:37:46 +0000 (16:37 +0100)
committerMatt Caswell <matt@openssl.org>
Fri, 2 Jun 2017 09:40:13 +0000 (10:40 +0100)
commit51909407c2acbcb36dde31314676924d2fee29a1
tree6a15882123aee05360ef519495ab75850cc89185
parenta2d9cfbac5d87b03496d62079aef01c601193b58
Left shift of a negative number is undefined behaviour

Fix undefined behaviour in curve25519.c. Prior to this running with
ubsan produces errors like this:

crypto/ec/curve25519.c:3871:18: runtime error: left shift of negative
value -22867

[extended tests]

Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3600)
crypto/ec/curve25519.c