aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2017-10-02 23:33:53 -0400
committerJack Lloyd <[email protected]>2017-10-02 23:34:21 -0400
commitf9090ec68986d297fd4cfd97bf75521df8f38aff (patch)
treeb7a7f687e8a4b5842f68c644ab0b3e8766f19a45 /src/lib
parent9701249c99e4775d7015ce5d6a884626cc8f2673 (diff)
Remove protected functions from final classes
Mostly residue from the old system of splitting impls among subclasses Found with Sonar
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/block/serpent/serpent.h18
-rw-r--r--src/lib/block/threefish/threefish.h3
-rw-r--r--src/lib/block/xtea/xtea.h5
-rw-r--r--src/lib/filters/basefilt.h4
-rw-r--r--src/lib/filters/cipher_filter.h5
-rw-r--r--src/lib/hash/md4/md4.h4
-rw-r--r--src/lib/hash/md5/md5.h4
-rw-r--r--src/lib/hash/sm3/sm3.h3
8 files changed, 8 insertions, 38 deletions
diff --git a/src/lib/block/serpent/serpent.h b/src/lib/block/serpent/serpent.h
index a6463546e..bad0e0fad 100644
--- a/src/lib/block/serpent/serpent.h
+++ b/src/lib/block/serpent/serpent.h
@@ -29,7 +29,7 @@ class BOTAN_PUBLIC_API(2,0) Serpent final : public Block_Cipher_Fixed_Params<16,
size_t parallelism() const override { return 4; }
- protected:
+ private:
#if defined(BOTAN_HAS_SERPENT_SIMD)
/**
* Encrypt 4 blocks in parallel using SSE2 or AltiVec
@@ -42,22 +42,6 @@ class BOTAN_PUBLIC_API(2,0) Serpent final : public Block_Cipher_Fixed_Params<16,
void simd_decrypt_4(const uint8_t in[64], uint8_t out[64]) const;
#endif
- /**
- * For use by subclasses using SIMD, asm, etc
- * @return const reference to the key schedule
- */
- const secure_vector<uint32_t>& get_round_keys() const
- { return m_round_key; }
-
- /**
- * For use by subclasses that implement the key schedule
- * @param ks is the new key schedule value to set
- */
- void set_round_keys(const uint32_t ks[132])
- {
- m_round_key.assign(&ks[0], &ks[132]);
- }
-
private:
void key_schedule(const uint8_t key[], size_t length) override;
secure_vector<uint32_t> m_round_key;
diff --git a/src/lib/block/threefish/threefish.h b/src/lib/block/threefish/threefish.h
index de46913c5..4281e822b 100644
--- a/src/lib/block/threefish/threefish.h
+++ b/src/lib/block/threefish/threefish.h
@@ -29,10 +29,9 @@ class BOTAN_PUBLIC_API(2,0) Threefish_512 final : public Block_Cipher_Fixed_Para
BlockCipher* clone() const override { return new Threefish_512; }
size_t parallelism() const override;
- protected:
+ private:
const secure_vector<uint64_t>& get_T() const { return m_T; }
const secure_vector<uint64_t>& get_K() const { return m_K; }
- private:
#if defined(BOTAN_HAS_THREEFISH_512_AVX2)
void avx2_encrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const;
diff --git a/src/lib/block/xtea/xtea.h b/src/lib/block/xtea/xtea.h
index 3ce0fda58..5ec94fd05 100644
--- a/src/lib/block/xtea/xtea.h
+++ b/src/lib/block/xtea/xtea.h
@@ -24,11 +24,6 @@ class BOTAN_PUBLIC_API(2,0) XTEA final : public Block_Cipher_Fixed_Params<8, 16>
void clear() override;
std::string name() const override { return "XTEA"; }
BlockCipher* clone() const override { return new XTEA; }
- protected:
- /**
- * @return const reference to the key schedule
- */
- const secure_vector<uint32_t>& get_EK() const { return m_EK; }
private:
void key_schedule(const uint8_t[], size_t) override;
diff --git a/src/lib/filters/basefilt.h b/src/lib/filters/basefilt.h
index 01bcad756..9f64ebcdb 100644
--- a/src/lib/filters/basefilt.h
+++ b/src/lib/filters/basefilt.h
@@ -108,11 +108,9 @@ class BOTAN_PUBLIC_API(2,0) Threaded_Fork final : public Fork
~Threaded_Fork();
- protected:
+ private:
void set_next(Filter* f[], size_t n);
void send(const uint8_t in[], size_t length) override;
-
- private:
void thread_delegate_work(const uint8_t input[], size_t length);
void thread_entry(Filter* filter);
diff --git a/src/lib/filters/cipher_filter.h b/src/lib/filters/cipher_filter.h
index 94cfa71df..f0082be5b 100644
--- a/src/lib/filters/cipher_filter.h
+++ b/src/lib/filters/cipher_filter.h
@@ -33,11 +33,6 @@ class BOTAN_PUBLIC_API(2,0) Cipher_Mode_Filter final : public Keyed_Filter,
std::string name() const override;
- protected:
- const Cipher_Mode& get_mode() const { return *m_mode; }
-
- Cipher_Mode& get_mode() { return *m_mode; }
-
private:
void write(const uint8_t input[], size_t input_length) override;
void start_msg() override;
diff --git a/src/lib/hash/md4/md4.h b/src/lib/hash/md4/md4.h
index 15f796df8..c51cb1682 100644
--- a/src/lib/hash/md4/md4.h
+++ b/src/lib/hash/md4/md4.h
@@ -27,10 +27,10 @@ class BOTAN_PUBLIC_API(2,0) MD4 final : public MDx_HashFunction
MD4() : MDx_HashFunction(64, false, true), m_M(16), m_digest(4)
{ clear(); }
- protected:
+
+ private:
void compress_n(const uint8_t input[], size_t blocks) override;
void copy_out(uint8_t[]) override;
- private:
/**
* The message buffer
diff --git a/src/lib/hash/md5/md5.h b/src/lib/hash/md5/md5.h
index 54231e785..07d10fb7a 100644
--- a/src/lib/hash/md5/md5.h
+++ b/src/lib/hash/md5/md5.h
@@ -27,11 +27,11 @@ class BOTAN_PUBLIC_API(2,0) MD5 final : public MDx_HashFunction
MD5() : MDx_HashFunction(64, false, true), m_M(16), m_digest(4)
{ clear(); }
- protected:
+
+ private:
void compress_n(const uint8_t[], size_t blocks) override;
void copy_out(uint8_t[]) override;
- private:
/**
* The message buffer
*/
diff --git a/src/lib/hash/sm3/sm3.h b/src/lib/hash/sm3/sm3.h
index 5aa0f289c..56471e7d1 100644
--- a/src/lib/hash/sm3/sm3.h
+++ b/src/lib/hash/sm3/sm3.h
@@ -32,11 +32,10 @@ class BOTAN_PUBLIC_API(2,2) SM3 final : public MDx_HashFunction
SM3() : MDx_HashFunction(SM3_BLOCK_BYTES, true, true), m_digest(SM3_DIGEST_BYTES)
{ clear(); }
- protected:
+ private:
void compress_n(const uint8_t[], size_t blocks) override;
void copy_out(uint8_t[]) override;
- private:
/**
* The digest value
*/