| 6 | // You may obtain a copy of the License at |
| 7 | // |
| 8 | // https://www.apache.org/licenses/LICENSE-2.0 |
| 9 | // |
| 10 | // Unless required by applicable law or agreed to in writing, software |
| 11 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | // See the License for the specific language governing permissions and |
| 14 | // limitations under the License. |
| 15 |
| 16 | #include "internal.h" |
| 17 |
| 18 | #if defined(OPENSSL_AARCH64) && defined(OPENSSL_WINDOWS) && \ |
| 19 | !defined(OPENSSL_STATIC_ARMCAP) && !defined(OPENSSL_NO_ASM) |
| 20 |
| 21 | #include <windows.h> |
| 22 |
| 23 |
| 24 | void OPENSSL_cpuid_setup(void) { |
| 25 | // We do not need to check for the presence of NEON, as Armv8-A always has it |
| 26 | OPENSSL_armcap_P |= ARMV7_NEON; |
| 27 |
| 28 | if (IsProcessorFeaturePresent(PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE)) { |
| 29 | // These are all covered by one call in Windows |
| 30 | OPENSSL_armcap_P |= ARMV8_AES; |
| 31 | OPENSSL_armcap_P |= ARMV8_PMULL; |
| 32 | OPENSSL_armcap_P |= ARMV8_SHA1; |
| 33 | OPENSSL_armcap_P |= ARMV8_SHA256; |
| 34 | } |
| 35 | // As of writing, Windows does not have a |PF_*| value for ARMv8.2 SHA-512 |
| 36 | // extensions. When it does, add it here. |
| 37 | } |
| 38 |
| 39 | #endif // OPENSSL_AARCH64 && OPENSSL_WINDOWS && !OPENSSL_STATIC_ARMCAP |
| 40 |