Cleanup includes for CRC32 and CRC32C
parent
65222dfe9e
commit
3ff04f1bf0
14
crc-simd.cpp
14
crc-simd.cpp
|
|
@ -10,23 +10,17 @@
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
|
|
||||||
// We set CRYPTOPP_ARM_CRC32_AVAILABLE based on compiler version.
|
|
||||||
// If the crc is not available, then we have to disable it here.
|
|
||||||
// Android does not provide -march=armv8-a+crc or -march=armv8.1-a+crc, so
|
|
||||||
// it looks like we will have to disable CRC acceleration of their devices.
|
|
||||||
#if !(defined(__ARM_FEATURE_CRC32) || defined(_MSC_VER)) || defined(__ANDROID__)
|
|
||||||
# undef CRYPTOPP_ARM_CRC32_AVAILABLE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if (CRYPTOPP_SSE42_AVAILABLE)
|
#if (CRYPTOPP_SSE42_AVAILABLE)
|
||||||
# include <nmmintrin.h>
|
# include <nmmintrin.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (CRYPTOPP_ARM_CRC32_AVAILABLE)
|
#if (CRYPTOPP_ARM_CRC32_AVAILABLE)
|
||||||
# include <arm_neon.h>
|
# include <arm_neon.h>
|
||||||
# if defined(CRYPTOPP_ARM_ACLE_AVAILABLE)
|
|
||||||
# include <arm_acle.h>
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(CRYPTOPP_ARM_ACLE_AVAILABLE)
|
||||||
|
# include <stdint.h>
|
||||||
|
# include <arm_acle.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CRYPTOPP_GNU_STYLE_INLINE_ASSEMBLY
|
#ifdef CRYPTOPP_GNU_STYLE_INLINE_ASSEMBLY
|
||||||
|
|
|
||||||
13
crc.cpp
13
crc.cpp
|
|
@ -8,13 +8,6 @@
|
||||||
|
|
||||||
NAMESPACE_BEGIN(CryptoPP)
|
NAMESPACE_BEGIN(CryptoPP)
|
||||||
|
|
||||||
// We set CRYPTOPP_ARM_CRC32_AVAILABLE based on compiler version.
|
|
||||||
// Android does not provide -march=armv8-a+crc or -march=armv8.1-a+crc, so
|
|
||||||
// it looks like we will have to disable CRC acceleration of their devices.
|
|
||||||
#if defined(__ANDROID__)
|
|
||||||
# undef CRYPTOPP_ARM_CRC32_AVAILABLE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// crc-simd.cpp
|
// crc-simd.cpp
|
||||||
#if (CRYPTOPP_ARM_CRC32_AVAILABLE)
|
#if (CRYPTOPP_ARM_CRC32_AVAILABLE)
|
||||||
extern void CRC32_Update_ARMV8(const byte *s, size_t n, word32& c);
|
extern void CRC32_Update_ARMV8(const byte *s, size_t n, word32& c);
|
||||||
|
|
@ -164,8 +157,7 @@ void CRC32::Update(const byte *s, size_t n)
|
||||||
crc = m_tab[CRC32_INDEX(crc)] ^ CRC32_SHIFTED(crc);
|
crc = m_tab[CRC32_INDEX(crc)] ^ CRC32_SHIFTED(crc);
|
||||||
crc = m_tab[CRC32_INDEX(crc)] ^ CRC32_SHIFTED(crc);
|
crc = m_tab[CRC32_INDEX(crc)] ^ CRC32_SHIFTED(crc);
|
||||||
crc = m_tab[CRC32_INDEX(crc)] ^ CRC32_SHIFTED(crc);
|
crc = m_tab[CRC32_INDEX(crc)] ^ CRC32_SHIFTED(crc);
|
||||||
n -= 4;
|
n -= 4; s += 4;
|
||||||
s += 4;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
while (n--)
|
while (n--)
|
||||||
|
|
@ -330,8 +322,7 @@ void CRC32C::Update(const byte *s, size_t n)
|
||||||
crc = m_tab[CRC32_INDEX(crc)] ^ CRC32_SHIFTED(crc);
|
crc = m_tab[CRC32_INDEX(crc)] ^ CRC32_SHIFTED(crc);
|
||||||
crc = m_tab[CRC32_INDEX(crc)] ^ CRC32_SHIFTED(crc);
|
crc = m_tab[CRC32_INDEX(crc)] ^ CRC32_SHIFTED(crc);
|
||||||
crc = m_tab[CRC32_INDEX(crc)] ^ CRC32_SHIFTED(crc);
|
crc = m_tab[CRC32_INDEX(crc)] ^ CRC32_SHIFTED(crc);
|
||||||
n -= 4;
|
n -= 4; s += 4;
|
||||||
s += 4;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
while (n--)
|
while (n--)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue