Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/crypto/external/bsd/openssl/dist/crypto Expand on importance...



details:   https://anonhg.NetBSD.org/src/rev/0e3146f71826
branches:  trunk
changeset: 973969:0e3146f71826
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Jul 19 15:33:08 2020 +0000

description:
Expand on importance of not using fpu for crypto if there's no fpu.

diffstat:

 crypto/external/bsd/openssl/dist/crypto/ppccap.c |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (17 lines):

diff -r f429c14bfa2f -r 0e3146f71826 crypto/external/bsd/openssl/dist/crypto/ppccap.c
--- a/crypto/external/bsd/openssl/dist/crypto/ppccap.c  Sun Jul 19 15:16:22 2020 +0000
+++ b/crypto/external/bsd/openssl/dist/crypto/ppccap.c  Sun Jul 19 15:33:08 2020 +0000
@@ -374,8 +374,11 @@
     size_t len = sizeof(val);
 
     /*
-     * If machdep.fpu_present == 0, FPU is absent and emulated by software.
-     * Avoid using it for better performance.
+     * If machdep.fpu_present == 0, FPU is absent and emulated by
+     * software.  In that case, using FPU instructions hurts rather
+     * than helps performance, and the software is unlikely to run in
+     * constant time so it would expose us to timing side channel
+     * attacks.  So don't do it!
      */
     error = sysctlbyname("machdep.fpu_present", &val, &len, NULL, 0);
     if (error != 0 || (error == 0 && val != 0))



Home | Main Index | Thread Index | Old Index