diff options
author | Malfurious <m@lfurio.us> | 2024-10-21 11:09:00 -0400 |
---|---|---|
committer | Malfurious <m@lfurio.us> | 2024-10-24 06:41:41 -0400 |
commit | 5494fc310acf0aabb9d828451331e44483eb21c7 (patch) | |
tree | 77280a586d52470fca89b9ed73f5f1faaf7907c6 /cryptopp562/words.h | |
parent | 428471d39fb8c205a9fad899c88c30a2cb7df685 (diff) | |
download | compass-5494fc310acf0aabb9d828451331e44483eb21c7.tar.gz compass-5494fc310acf0aabb9d828451331e44483eb21c7.zip |
Remove Crypto++ library
The tracked version of Crypto++ is going on 10 years old and doesn't
always compile properly on modern tooling.
This removes the entire subdirectory as well as references to files in
the build script. Due to the number of files touched by this commit, I
opt to add its replacement in the next commit.
Signed-off-by: Malfurious <m@lfurio.us>
Diffstat (limited to 'cryptopp562/words.h')
-rw-r--r-- | cryptopp562/words.h | 103 |
1 files changed, 0 insertions, 103 deletions
diff --git a/cryptopp562/words.h b/cryptopp562/words.h deleted file mode 100644 index d5fda71..0000000 --- a/cryptopp562/words.h +++ /dev/null @@ -1,103 +0,0 @@ -#ifndef CRYPTOPP_WORDS_H -#define CRYPTOPP_WORDS_H - -#include "misc.h" - -NAMESPACE_BEGIN(CryptoPP) - -inline size_t CountWords(const word *X, size_t N) -{ - while (N && X[N-1]==0) - N--; - return N; -} - -inline void SetWords(word *r, word a, size_t n) -{ - for (size_t i=0; i<n; i++) - r[i] = a; -} - -inline void CopyWords(word *r, const word *a, size_t n) -{ - if (r != a) - memcpy(r, a, n*WORD_SIZE); -} - -inline void XorWords(word *r, const word *a, const word *b, size_t n) -{ - for (size_t i=0; i<n; i++) - r[i] = a[i] ^ b[i]; -} - -inline void XorWords(word *r, const word *a, size_t n) -{ - for (size_t i=0; i<n; i++) - r[i] ^= a[i]; -} - -inline void AndWords(word *r, const word *a, const word *b, size_t n) -{ - for (size_t i=0; i<n; i++) - r[i] = a[i] & b[i]; -} - -inline void AndWords(word *r, const word *a, size_t n) -{ - for (size_t i=0; i<n; i++) - r[i] &= a[i]; -} - -inline word ShiftWordsLeftByBits(word *r, size_t n, unsigned int shiftBits) -{ - assert (shiftBits<WORD_BITS); - word u, carry=0; - if (shiftBits) - for (size_t i=0; i<n; i++) - { - u = r[i]; - r[i] = (u << shiftBits) | carry; - carry = u >> (WORD_BITS-shiftBits); - } - return carry; -} - -inline word ShiftWordsRightByBits(word *r, size_t n, unsigned int shiftBits) -{ - assert (shiftBits<WORD_BITS); - word u, carry=0; - if (shiftBits) - for (size_t i=n; i>0; i--) - { - u = r[i-1]; - r[i-1] = (u >> shiftBits) | carry; - carry = u << (WORD_BITS-shiftBits); - } - return carry; -} - -inline void ShiftWordsLeftByWords(word *r, size_t n, size_t shiftWords) -{ - shiftWords = STDMIN(shiftWords, n); - if (shiftWords) - { - for (size_t i=n-1; i>=shiftWords; i--) - r[i] = r[i-shiftWords]; - SetWords(r, 0, shiftWords); - } -} - -inline void ShiftWordsRightByWords(word *r, size_t n, size_t shiftWords) -{ - shiftWords = STDMIN(shiftWords, n); - if (shiftWords) - { - for (size_t i=0; i+shiftWords<n; i++) - r[i] = r[i+shiftWords]; - SetWords(r+n-shiftWords, 0, shiftWords); - } -} - -NAMESPACE_END - -#endif |