Add flag use_target_attributes
This commit is contained in:
parent
f5706959a4
commit
0cf0d076ab
@ -40,8 +40,13 @@
|
|||||||
#include <cryptonite_aes.h>
|
#include <cryptonite_aes.h>
|
||||||
#include <aes/block128.h>
|
#include <aes/block128.h>
|
||||||
|
|
||||||
|
#ifdef WITH_TARGET_ATTRIBUTES
|
||||||
#define TARGET_AESNI __attribute__((target("ssse3,aes")))
|
#define TARGET_AESNI __attribute__((target("ssse3,aes")))
|
||||||
#define TARGET_AESNI_PCLMUL __attribute__((target("sse4.1,aes,pclmul")))
|
#define TARGET_AESNI_PCLMUL __attribute__((target("sse4.1,aes,pclmul")))
|
||||||
|
#else
|
||||||
|
#define TARGET_AESNI
|
||||||
|
#define TARGET_AESNI_PCLMUL
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef IMPL_DEBUG
|
#ifdef IMPL_DEBUG
|
||||||
TARGET_AESNI
|
TARGET_AESNI
|
||||||
|
|||||||
@ -103,6 +103,11 @@ Flag check_alignment
|
|||||||
Default: False
|
Default: False
|
||||||
Manual: True
|
Manual: True
|
||||||
|
|
||||||
|
Flag use_target_attributes
|
||||||
|
Description: use GCC / clang function attributes instead of global target options.
|
||||||
|
Default: False
|
||||||
|
Manual: True
|
||||||
|
|
||||||
Library
|
Library
|
||||||
Exposed-modules: Crypto.Cipher.AES
|
Exposed-modules: Crypto.Cipher.AES
|
||||||
Crypto.Cipher.AESGCMSIV
|
Crypto.Cipher.AESGCMSIV
|
||||||
@ -337,8 +342,12 @@ Library
|
|||||||
|
|
||||||
if flag(support_aesni) && (os(linux) || os(freebsd) || os(osx)) && (arch(i386) || arch(x86_64))
|
if flag(support_aesni) && (os(linux) || os(freebsd) || os(osx)) && (arch(i386) || arch(x86_64))
|
||||||
CC-options: -DWITH_AESNI
|
CC-options: -DWITH_AESNI
|
||||||
|
if !flag(use_target_attributes)
|
||||||
|
CC-options: -mssse3 -maes
|
||||||
if flag(support_pclmuldq)
|
if flag(support_pclmuldq)
|
||||||
CC-options: -DWITH_PCLMUL
|
CC-options: -DWITH_PCLMUL
|
||||||
|
if !flag(use_target_attributes)
|
||||||
|
CC-options: -msse4.1 -mpclmul
|
||||||
C-sources: cbits/aes/x86ni.c
|
C-sources: cbits/aes/x86ni.c
|
||||||
, cbits/aes/generic.c
|
, cbits/aes/generic.c
|
||||||
, cbits/aes/gf.c
|
, cbits/aes/gf.c
|
||||||
@ -385,6 +394,8 @@ Library
|
|||||||
Build-depends: deepseq
|
Build-depends: deepseq
|
||||||
if flag(check_alignment)
|
if flag(check_alignment)
|
||||||
cc-options: -DWITH_ASSERT_ALIGNMENT
|
cc-options: -DWITH_ASSERT_ALIGNMENT
|
||||||
|
if flag(use_target_attributes)
|
||||||
|
cc-options: -DWITH_TARGET_ATTRIBUTES
|
||||||
|
|
||||||
Test-Suite test-cryptonite
|
Test-Suite test-cryptonite
|
||||||
type: exitcode-stdio-1.0
|
type: exitcode-stdio-1.0
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user