salsa2012.h 608 B

1234567891011121314151617181920212223
  1. #ifndef ZT_SALSA2012_ARM32NEON_ASM
  2. #define ZT_SALSA2012_ARM32NEON_ASM
  3. #if defined(__linux__) || defined(linux) || defined(__LINUX__) || defined(__linux)
  4. #include <sys/auxv.h>
  5. #include <asm/hwcap.h>
  6. #define zt_arm_has_neon() (getauxval(AT_HWCAP) & HWCAP_NEON)
  7. #else
  8. #define zt_arm_has_neon() (true)
  9. #endif
  10. #ifdef __cplusplus
  11. extern "C" {
  12. #endif
  13. // ciphertext buffer, message/NULL, length, nonce (8 bytes), key (32 bytes)
  14. extern int zt_salsa2012_armneon3_xor(unsigned char *c,const unsigned char *m,unsigned long long len,const unsigned char *n,const unsigned char *k);
  15. #ifdef __cplusplus
  16. }
  17. #endif
  18. #endif