OLD | NEW |
1 /* crypto/cryptlib.c */ | 1 /* crypto/cryptlib.c */ |
2 /* ==================================================================== | 2 /* ==================================================================== |
3 * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. | 3 * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
654 if (type < 0) | 654 if (type < 0) |
655 return("dynamic"); | 655 return("dynamic"); |
656 else if (type < CRYPTO_NUM_LOCKS) | 656 else if (type < CRYPTO_NUM_LOCKS) |
657 return(lock_names[type]); | 657 return(lock_names[type]); |
658 else if (type-CRYPTO_NUM_LOCKS > sk_OPENSSL_STRING_num(app_locks)) | 658 else if (type-CRYPTO_NUM_LOCKS > sk_OPENSSL_STRING_num(app_locks)) |
659 return("ERROR"); | 659 return("ERROR"); |
660 else | 660 else |
661 return(sk_OPENSSL_STRING_value(app_locks,type-CRYPTO_NUM_LOCKS))
; | 661 return(sk_OPENSSL_STRING_value(app_locks,type-CRYPTO_NUM_LOCKS))
; |
662 } | 662 } |
663 | 663 |
| 664 #if __arm__ |
| 665 static int global_arm_neon_enabled = 0; |
| 666 |
| 667 void CRYPTO_set_NEON_capable(int on) |
| 668 { |
| 669 global_arm_neon_enabled = on != 0; |
| 670 } |
| 671 |
| 672 int CRYPTO_is_NEON_capable() |
| 673 { |
| 674 return global_arm_neon_enabled; |
| 675 } |
| 676 #endif |
| 677 |
664 #if defined(__i386) || defined(__i386__) || defined(_M_IX86) || \ | 678 #if defined(__i386) || defined(__i386__) || defined(_M_IX86) || \ |
665 defined(__INTEL__) || \ | 679 defined(__INTEL__) || \ |
666 defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64) || defined
(_M_X64) | 680 defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64) || defined
(_M_X64) |
667 | 681 |
668 unsigned int OPENSSL_ia32cap_P[2]; | 682 unsigned int OPENSSL_ia32cap_P[2]; |
669 unsigned long *OPENSSL_ia32cap_loc(void) | 683 unsigned long *OPENSSL_ia32cap_loc(void) |
670 { if (sizeof(long)==4) | 684 { if (sizeof(long)==4) |
671 /* | 685 /* |
672 * If 32-bit application pulls address of OPENSSL_ia32cap_P[0] | 686 * If 32-bit application pulls address of OPENSSL_ia32cap_P[0] |
673 * clear second element to maintain the illusion that vector | 687 * clear second element to maintain the illusion that vector |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
931 size_t i; | 945 size_t i; |
932 const unsigned char *a = in_a; | 946 const unsigned char *a = in_a; |
933 const unsigned char *b = in_b; | 947 const unsigned char *b = in_b; |
934 unsigned char x = 0; | 948 unsigned char x = 0; |
935 | 949 |
936 for (i = 0; i < len; i++) | 950 for (i = 0; i < len; i++) |
937 x |= a[i] ^ b[i]; | 951 x |= a[i] ^ b[i]; |
938 | 952 |
939 return x; | 953 return x; |
940 } | 954 } |
OLD | NEW |