git: e60e29c80af8 - main - security/openfhe: fix build on powerpc*

From: Piotr Kubaj <pkubaj_at_FreeBSD.org>
Date: Tue, 06 Dec 2022 03:51:54 UTC
The branch main has been updated by pkubaj:

URL: https://cgit.FreeBSD.org/ports/commit/?id=e60e29c80af8ea6900cb04fb206f41639be0ea22

commit e60e29c80af8ea6900cb04fb206f41639be0ea22
Author:     Piotr Kubaj <pkubaj@FreeBSD.org>
AuthorDate: 2022-12-06 03:51:51 +0000
Commit:     Piotr Kubaj <pkubaj@FreeBSD.org>
CommitDate: 2022-12-06 03:51:51 +0000

    security/openfhe: fix build on powerpc*
    
    Same patch as for security/palisade.
---
 ...tch-src_core_include_math_hal_intnat_ubintnat.h | 26 ++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/security/openfhe/files/patch-src_core_include_math_hal_intnat_ubintnat.h b/security/openfhe/files/patch-src_core_include_math_hal_intnat_ubintnat.h
new file mode 100644
index 000000000000..80ef4c33431c
--- /dev/null
+++ b/security/openfhe/files/patch-src_core_include_math_hal_intnat_ubintnat.h
@@ -0,0 +1,26 @@
+--- src/core/include/math/hal/intnat/ubintnat.h.orig	2022-12-06 03:29:13 UTC
++++ src/core/include/math/hal/intnat/ubintnat.h
+@@ -2152,17 +2152,17 @@ class NativeIntegerT : public lbcrypto::BigIntegerInte
+         res.lo = x.lo * y;
+         asm("umulh %0, %1, %2\n\t" : "=r"(res.hi) : "r"(x.lo), "r"(y));
+         res.hi += x.hi * y;
+-#elif defined(__arm__)  // 32 bit processor
++#elif defined(__powerpc64__) || defined(__riscv)
++        U128BITS wres(0), wa(a), wb(b);
++        wres   = wa * wb;  // should give us 128 bits  of 64 * 64
++        res.hi = (uint64_t)(wres >> 64);
++        res.lo = (uint64_t)wres;
++#elif defined(__arm__)  || defined(__powerpc__) // 32 bit processor
+         uint64_t wres(0), wa(a), wb(b);
+ 
+         wres   = wa * wb;  // should give us the lower 64 bits of 32*32
+         res.hi = wres >> 32;
+         res.lo = (uint32_t)wres & 0xFFFFFFFF;
+-#elif __riscv
+-        U128BITS wres(0), wa(a), wb(b);
+-        wres   = wa * wb;  // should give us 128 bits  of 64 * 64
+-        res.hi = (uint64_t)(wres >> 64);
+-        res.lo = (uint64_t)wres;
+ #elif defined(__EMSCRIPTEN__)  // web assembly
+         U64BITS a1 = a >> 32;
+         U64BITS a2 = (uint32_t)a;