Engage GHASH for PowerISA 2.0.7.
[openssl.git] / crypto / ppccap.c
index 4c5e88d3a0c830b2da1bc9ffb616e4c16e223f8e..13c2ca51627cba83a1a86a9e7cab85979b1b6724 100644 (file)
@@ -10,9 +10,7 @@
 #include <crypto.h>
 #include <openssl/bn.h>
 
-#define PPC_FPU64      (1<<0)
-#define PPC_ALTIVEC    (1<<1)
-#define PPC_CRYPTO207  (1<<2)
+#include "ppc_arch.h"
 
 unsigned int OPENSSL_ppccap_P = 0;
 
@@ -54,6 +52,22 @@ int bn_mul_mont(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp, const BN_U
        }
 #endif
 
+void sha256_block_p8(void *ctx,const void *inp,size_t len);
+void sha256_block_ppc(void *ctx,const void *inp,size_t len);
+void sha256_block_data_order(void *ctx,const void *inp,size_t len)
+       {
+       OPENSSL_ppccap_P&PPC_CRYPTO207? sha256_block_p8(ctx,inp,len):
+                                       sha256_block_ppc(ctx,inp,len);
+       }
+
+void sha512_block_p8(void *ctx,const void *inp,size_t len);
+void sha512_block_ppc(void *ctx,const void *inp,size_t len);
+void sha512_block_data_order(void *ctx,const void *inp,size_t len)
+       {
+       OPENSSL_ppccap_P&PPC_CRYPTO207? sha512_block_p8(ctx,inp,len):
+                                       sha512_block_ppc(ctx,inp,len);
+       }
+
 static sigjmp_buf ill_jmp;
 static void ill_handler (int sig) { siglongjmp(ill_jmp,sig); }