cosmetic fixes
This commit is contained in:
parent
9e5f5154b4
commit
6a8029e626
|
@ -30,15 +30,13 @@ class arcfour : public streamcipher
|
|||
inttype I, J;
|
||||
inttype mask;
|
||||
public:
|
||||
bool init () {
|
||||
void init () {
|
||||
size_t Ssize = 1 << bits;
|
||||
if (bits > 8 * sizeof (inttype) ) return false;
|
||||
I = J = 0;
|
||||
S.resize (Ssize);
|
||||
mask = ~ (inttype) 0;
|
||||
if ( (inttype) (1 << bits) ) mask %= 1 << bits;
|
||||
for (size_t i = 0; i < Ssize; ++i) S[i] = i;
|
||||
return true;
|
||||
}
|
||||
|
||||
void clear() {
|
||||
|
@ -97,6 +95,10 @@ public:
|
|||
gen (n, & (out[0]) );
|
||||
}
|
||||
|
||||
size_t key_size() {
|
||||
return 256;
|
||||
}
|
||||
|
||||
size_t block_size() {
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -60,7 +60,7 @@ class size64proc : public hash_proc
|
|||
};
|
||||
|
||||
/*
|
||||
* list of hash functions availabel
|
||||
* list of hash functions available
|
||||
*/
|
||||
|
||||
typedef map<string, hash_proc*> hashmap;
|
||||
|
|
5
src/sc.h
5
src/sc.h
|
@ -26,11 +26,14 @@
|
|||
class streamcipher
|
||||
{
|
||||
public:
|
||||
virtual bool init() = 0;
|
||||
virtual void init() = 0;
|
||||
virtual void clear() = 0;
|
||||
virtual void load_key (const byte*begin, const byte*end) = 0;
|
||||
virtual byte gen() = 0;
|
||||
virtual void gen (size_t n, byte*out) = 0;
|
||||
|
||||
//advisory values for effective usage
|
||||
virtual size_t key_size() = 0;
|
||||
virtual size_t block_size() = 0;
|
||||
|
||||
void discard (size_t n) {
|
||||
|
|
Loading…
Reference in a new issue