-
大小: 1.39MB文件类型: .gz金币: 1下载: 0 次发布日期: 2023-08-29
- 语言: 其他
- 标签: openssl-fips
资源简介
openssl-fips-2.0.12.tar.gz是linux工具包。
代码片段和文件信息
#include
#include
#include
#include
#include
#include
#include “arm_arch.h“
unsigned int OPENSSL_armcap_P;
static sigset_t all_masked;
static sigjmp_buf ill_jmp;
static void ill_handler (int sig) { siglongjmp(ill_jmpsig); }
/*
* Following subroutines could have been inlined but it‘s not all
* ARM compilers support inline assembler...
*/
void _armv7_neon_probe(void);
unsigned int _armv7_tick(void);
void _armv8_aes_probe(void);
void _armv8_sha1_probe(void);
void _armv8_sha256_probe(void);
void _armv8_pmull_probe(void);
unsigned int OPENSSL_rdtsc(void)
{
if (OPENSSL_armcap_P|ARMV7_TICK)
return _armv7_tick();
else
return 0;
}
#if defined(__GNUC__) && __GNUC__>=2
void OPENSSL_cpuid_setup(void) __attribute__((constructor));
#endif
void OPENSSL_cpuid_setup(void)
{
char *e;
struct sigaction ill_oactill_act;
sigset_t oset;
static int trigger=0;
if (trigger) return;
trigger=1;
if ((e=getenv(“OPENSSL_armcap“)))
{
OPENSSL_armcap_P=strtoul(eNULL0);
return;
}
sigfillset(&all_masked);
sigdelset(&all_maskedSIGILL);
sigdelset(&all_maskedSIGTRAP);
sigdelset(&all_maskedSIGFPE);
sigdelset(&all_maskedSIGBUS);
sigdelset(&all_maskedSIGSEGV);
OPENSSL_armcap_P = 0;
memset(&ill_act0sizeof(ill_act));
ill_act.sa_handler = ill_handler;
ill_act.sa_mask = all_masked;
sigprocmask(SIG_SETMASK&ill_act.sa_mask&oset);
sigaction(SIGILL&ill_act&ill_oact);
if (sigsetjmp(ill_jmp1) == 0)
{
_armv7_neon_probe();
OPENSSL_armcap_P |= ARMV7_NEON;
#ifdef __aarch64__
if (sigsetjmp(ill_jmp1) == 0)
{
_armv8_pmull_probe();
OPENSSL_armcap_P |= ARMV8_PMULL|ARMV8_AES;
}
else if (sigsetjmp(ill_jmp1) == 0)
{
_armv8_aes_probe();
OPENSSL_armcap_P |= ARMV8_AES;
}
if (sigsetjmp(ill_jmp1) == 0)
{
_armv8_sha1_probe();
OPENSSL_armcap_P |= ARMV8_SHA1;
}
if (sigsetjmp(ill_jmp1) == 0)
{
_armv8_sha256_probe();
OPENSSL_armcap_P |= ARMV8_SHA256;
}
#endif
}
if (sigsetjmp(ill_jmp1) == 0)
{
_armv7_tick();
OPENSSL_armcap_P |= ARMV7_TICK;
}
sigaction (SIGILL&ill_oactNULL);
sigprocmask(SIG_SETMASK&osetNULL);
}
- 上一篇:2d游戏之五子棋
- 下一篇:MCTK.rar小插件的安装包
评论
共有 条评论