tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

ppc-crypto.h (937B)


      1 /* This Source Code Form is subject to the terms of the Mozilla Public
      2 * License, v. 2.0. If a copy of the MPL was not distributed with this
      3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      4 
      5 #ifndef PPC_CRYPTO_H
      6 #define PPC_CRYPTO_H 1
      7 
      8 #if defined(__powerpc64__) && defined(__ALTIVEC__) && \
      9    !defined(NSS_DISABLE_ALTIVEC)
     10 #include "altivec-types.h"
     11 
     12 /* The ghash freebl test tries to use this in C++, and gcc defines conflict. */
     13 #ifdef __cplusplus
     14 #undef pixel
     15 #undef vector
     16 #undef bool
     17 #endif
     18 
     19 /*
     20 * PPC CRYPTO requires at least gcc 8 or clang. The LE check is purely
     21 * because it's only been tested on LE. If you're interested in BE,
     22 * please send a patch.
     23 */
     24 #if (defined(__clang__) || (defined(__GNUC__) && __GNUC__ >= 8)) && \
     25    defined(IS_LITTLE_ENDIAN) && defined(__VSX__)
     26 #define USE_PPC_CRYPTO
     27 #endif
     28 
     29 #endif /* defined(__powerpc64__) && !defined(NSS_DISABLE_ALTIVEC) && defined(__ALTIVEC__) */
     30 
     31 #endif