]> www.vanbest.org Git - sasc-ng.git/commitdiff
remove unused key compare code
authorleslie <unknown>
Fri, 25 Jul 2008 08:58:51 +0000 (16:58 +0800)
committerleslie <unknown>
Fri, 25 Jul 2008 08:58:51 +0000 (16:58 +0800)
data.c
data.h
system-common.c
system-common.h

diff --git a/data.c b/data.c
index 73584a5b3c67b1b641385aafbd5df3a4b0f40451..61a2865d057e4dfa0d8a52e55d9bbf7787708627 100644 (file)
--- 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<cMutableKey *>(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 eba9719908ae80796d05dc8a695f3e07b2cdac0b..3318e4b3d551cce14bc0c41b299fcba10671dd01 100644 (file)
--- 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);
index fdaec09afae702705896f8257e6a233bd79a48a8..e7bea941bf6b683f1a86b33b39ff991ad08f91fe 100644 (file)
@@ -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<cHexKey *>(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<cBNKey *>(k); // downcast
index 3d85d6152e1bb43623fd6a3447a48f5311d12c31..efe2a89f6e3774ccf062c891fb827b88909a6dde 100644 (file)
@@ -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; }