aboutsummaryrefslogtreecommitdiffstats
path: root/src/block/rc5/rc5.h
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-10-13 15:55:24 +0000
committerlloyd <[email protected]>2010-10-13 15:55:24 +0000
commit79d7cf0a42368db93f1641cc4daea37cd6d02f86 (patch)
treee6a20411fc0a1efed0a55636816534b71f9cdec9 /src/block/rc5/rc5.h
parent2da5513cb097a99e3423af158680ca84e7c1b99b (diff)
Implicit rounds based on key variable size
Diffstat (limited to 'src/block/rc5/rc5.h')
-rw-r--r--src/block/rc5/rc5.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/block/rc5/rc5.h b/src/block/rc5/rc5.h
index a9f3b5b0e..cb282af4e 100644
--- a/src/block/rc5/rc5.h
+++ b/src/block/rc5/rc5.h
@@ -23,7 +23,7 @@ class BOTAN_DLL RC5 : public BlockCipher_Fixed_Block_Size<8>
void clear() { zeroise(S); }
std::string name() const;
- BlockCipher* clone() const { return new RC5(ROUNDS); }
+ BlockCipher* clone() const { return new RC5(get_rounds()); }
/**
* @param rounds the number of RC5 rounds to run. Must be between
@@ -31,9 +31,11 @@ class BOTAN_DLL RC5 : public BlockCipher_Fixed_Block_Size<8>
*/
RC5(size_t rounds);
private:
+ size_t get_rounds() const { return (S.size() - 2) / 2; }
+
void key_schedule(const byte[], size_t);
+
SecureVector<u32bit> S;
- const size_t ROUNDS;
};
}