Return an error if no recipient type matches.
[openssl.git] / crypto / armcap.c
index 8dbd741..5504144 100644 (file)
@@ -19,18 +19,22 @@ static void ill_handler (int sig) { siglongjmp(ill_jmp,sig); }
  * ARM compilers support inline assembler...
  */
 void _armv7_neon_probe(void);
+void _armv8_aes_probe(void);
+void _armv8_sha1_probe(void);
+void _armv8_sha256_probe(void);
+void _armv8_pmull_probe(void);
 unsigned int _armv7_tick(void);
 
 unsigned int OPENSSL_rdtsc(void)
        {
-       if (OPENSSL_armcap_P|ARMV7_TICK)
+       if (OPENSSL_armcap_P & ARMV7_TICK)
                return _armv7_tick();
        else
                return 0;
        }
 
 #if defined(__GNUC__) && __GNUC__>=2
-void OPENSSL_cpuid_setup(void) __attribute__((constructor))
+void OPENSSL_cpuid_setup(void) __attribute__((constructor));
 #endif
 void OPENSSL_cpuid_setup(void)
        {
@@ -68,6 +72,26 @@ void OPENSSL_cpuid_setup(void)
                {
                _armv7_neon_probe();
                OPENSSL_armcap_P |= ARMV7_NEON;
+               if (sigsetjmp(ill_jmp,1) == 0)
+                       {
+                       _armv8_aes_probe();
+                       OPENSSL_armcap_P |= ARMV8_AES;
+                       }
+               if (sigsetjmp(ill_jmp,1) == 0)
+                       {
+                       _armv8_sha1_probe();
+                       OPENSSL_armcap_P |= ARMV8_SHA1;
+                       }
+               if (sigsetjmp(ill_jmp,1) == 0)
+                       {
+                       _armv8_sha256_probe();
+                       OPENSSL_armcap_P |= ARMV8_SHA256;
+                       }
+               if (sigsetjmp(ill_jmp,1) == 0)
+                       {
+                       _armv8_pmull_probe();
+                       OPENSSL_armcap_P |= ARMV8_PMULL;
+                       }
                }
        if (sigsetjmp(ill_jmp,1) == 0)
                {