From: leslie Date: Fri, 25 Jul 2008 08:58:51 +0000 (+0800) Subject: remove unused key compare code X-Git-Tag: 0.9.1~50 X-Git-Url: http://www.vanbest.org/gitweb/?a=commitdiff_plain;h=84e98ddaec31597c17597614c4a094f659452dd2;p=sasc-ng.git remove unused key compare code --- diff --git a/data.c b/data.c index 73584a5..61a2865 100644 --- a/data.c +++ b/data.c @@ -706,11 +706,6 @@ int cMutableKey::Size(void) return real->Size(); } -bool cMutableKey::Cmp(void *Key, int Keylen) -{ - return real->Cmp(Key,Keylen); -} - bool cMutableKey::Cmp(cPlainKey *k) { cMutableKey *mk=dynamic_cast(k); // high magic ;) @@ -740,7 +735,6 @@ public: cPlainKeyDummy(void); ~cPlainKeyDummy(); virtual bool Parse(const char *line); - virtual bool Cmp(void *Key, int Keylen) { return false; } virtual bool Cmp(cPlainKey *k) { return false; } virtual void Get(void *mem) {} virtual int Size(void) { return len; } diff --git a/data.h b/data.h index eba9719..3318e4b 100644 --- a/data.h +++ b/data.h @@ -269,7 +269,6 @@ public: cPlainKey(bool CanSupersede); virtual bool Parse(const char *line)=0; virtual cString ToString(bool hide); - virtual bool Cmp(void *Key, int Keylen)=0; virtual bool Cmp(cPlainKey *k)=0; virtual void Get(void *mem)=0; virtual int Size(void)=0; @@ -289,7 +288,6 @@ protected: public: cMutableKey(bool Super); virtual ~cMutableKey(); - virtual bool Cmp(void *Key, int Keylen); virtual bool Cmp(cPlainKey *k); virtual void Get(void *mem); virtual int Size(void); diff --git a/system-common.c b/system-common.c index fdaec09..e7bea94 100644 --- a/system-common.c +++ b/system-common.c @@ -55,15 +55,10 @@ bool cHexKey::SetBinKey(unsigned char *Mem, int Keylen) return SetKey(Mem,Keylen); } -bool cHexKey::Cmp(void *Key, int Keylen) -{ - return keylen==Keylen && memcmp(key,Key,keylen)==0; -} - bool cHexKey::Cmp(cPlainKey *k) { cHexKey *hk=dynamic_cast(k); // downcast - return hk && Cmp(hk->key,hk->keylen); + return hk && keylen==hk->keylen && memcmp(key,hk->key,keylen)==0; } void cHexKey::Get(void *mem) @@ -103,11 +98,6 @@ bool cBNKey::SetBinKey(unsigned char *Mem, int Keylen) return rotate ? key->GetLE(Mem,Keylen) : key->Get(Mem,Keylen); } -bool cBNKey::Cmp(void *Key, int Keylen) -{ - return BN_cmp(*key,(BIGNUM *)Key)==0; -} - bool cBNKey::Cmp(cPlainKey *k) { cBNKey *bk=dynamic_cast(k); // downcast diff --git a/system-common.h b/system-common.h index 3d85d61..efe2a89 100644 --- a/system-common.h +++ b/system-common.h @@ -33,7 +33,6 @@ protected: virtual bool SetKey(void *Key, int Keylen); virtual bool SetBinKey(unsigned char *Mem, int Keylen); virtual cString Print(void); - virtual bool Cmp(void *Key, int Keylen); virtual bool Cmp(cPlainKey *k); virtual void Get(void *mem); virtual int Size(void) { return keylen; } @@ -56,7 +55,6 @@ protected: virtual bool SetKey(void *Key, int Keylen); virtual bool SetBinKey(unsigned char *Mem, int Keylen); virtual cString Print(void); - virtual bool Cmp(void *Key, int Keylen); virtual bool Cmp(cPlainKey *k); virtual void Get(void *mem); virtual int Size(void) { return keylen; }