salsa2012.h 700 B

12345678910111213141516171819202122232425
  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) != 0)
  7. #elif defined(__ARM_NEON__) || defined(__ARM_NEON)
  8. #define zt_arm_has_neon() (true)
  9. #else
  10. #define zt_arm_has_neon() (false)
  11. #endif
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif
  15. // ciphertext buffer, message/NULL, length, nonce (8 bytes), key (32 bytes)
  16. 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);
  17. #ifdef __cplusplus
  18. }
  19. #endif
  20. #endif