hw-support.c (1705B)
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 #ifdef FREEBL_NO_DEPEND 6 #include "stubs.h" 7 #endif 8 9 /* This is a freebl command line utility that prints hardware support as freebl 10 * sees it from its detection in blinit.c 11 */ 12 13 #include <stdio.h> 14 15 #include "blapi.h" 16 #include "blapii.h" 17 #include "nss.h" 18 19 int main(int argc, char const *argv[]) { 20 BL_Init(); 21 printf("\n\n ========== NSS Hardware Report ==========\n"); 22 #if defined(NSS_X86_OR_X64) 23 printf("\tAES-NI \t%s supported\n", aesni_support() ? "" : "not"); 24 printf("\tPCLMUL \t%s supported\n", clmul_support() ? "" : "not"); 25 printf("\tSHA \t%s supported\n", sha_support() ? "" : "not"); 26 printf("\tAVX \t%s supported\n", avx_support() ? "" : "not"); 27 printf("\tAVX2 \t%s supported\n", avx2_support() ? "" : "not"); 28 printf("\tADX \t%s supported\n", adx_support() ? "" : "not"); 29 printf("\tSSSE3 \t%s supported\n", ssse3_support() ? "" : "not"); 30 printf("\tSSE4.1 \t%s supported\n", sse4_1_support() ? "" : "not"); 31 printf("\tSSE4.2 \t%s supported\n", sse4_2_support() ? "" : "not"); 32 #elif defined(__aarch64__) || defined(__arm__) 33 printf("\tNEON \t%s supported\n", arm_neon_support() ? "" : "not"); 34 printf("\tAES \t%s supported\n", arm_aes_support() ? "" : "not"); 35 printf("\tPMULL \t%s supported\n", arm_pmull_support() ? "" : "not"); 36 printf("\tSHA1 \t%s supported\n", arm_sha1_support() ? "" : "not"); 37 printf("\tSHA2 \t%s supported\n", arm_sha2_support() ? "" : "not"); 38 #endif 39 printf(" ========== Hardware Report End ==========\n\n\n"); 40 BL_Cleanup(); 41 return 0; 42 }