CVS: crypto/PublicKey DSA.py,1.12,1.13 ElGamal.py,1.6,1.7 RSA.py,1.14,1.15 pubkey.py,1.10,1.11 qNEW.py,1.6,1.7

"A.M. Kuchling" <[email protected]> Thu, 03 Apr 2003 12:36:50 -0800
Newsgroups gmane.comp.python.cryptography.cvs
Message-ID <[email protected]>
Update of /cvsroot/pycrypto/crypto/PublicKey
In directory sc8-pr-cvs1:/tmp/cvs-serv31665/PublicKey

Modified Files:
	DSA.py ElGamal.py RSA.py pubkey.py qNEW.py 
Log Message:
Rename can* and has* to can_* and has_*

Index: DSA.py
===================================================================
RCS file: /cvsroot/pycrypto/crypto/PublicKey/DSA.py,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- DSA.py	3 Apr 2003 18:19:03 -0000	1.12
+++ DSA.py	3 Apr 2003 20:36:09 -0000	1.13
@@ -130,17 +130,17 @@
         while (power<self.p): bits, power = bits+1, power<<1
         return bits-1
 
-    def hasprivate(self):
+    def has_private(self):
         """Return a Boolean denoting whether the object contains
         private components."""
         if hasattr(self, 'x'): return 1
         else: return 0
 
-    def cansign(self):
+    def can_sign(self):
         """Return a Boolean value recording whether this algorithm can generate signatures."""
         return 1
 
-    def canencrypt(self):
+    def can_encrypt(self):
         """Return a Boolean value recording whether this algorithm can encrypt data."""
         return 0
 
@@ -192,16 +192,16 @@
     def size(self):
         return self.key.size()
 
-    def hasprivate(self):
-        return self.key.hasprivate()
+    def has_private(self):
+        return self.key.has_private()
 
     def publickey(self):
         return construct_c((self.key.y, self.key.g, self.key.p, self.key.q))
 
-    def cansign(self):
+    def can_sign(self):
         return 1
 
-    def canencrypt(self):
+    def can_encrypt(self):
         return 0
 
 def generate_c(bits, randfunc, progress_func=None):

Index: ElGamal.py
===================================================================
RCS file: /cvsroot/pycrypto/crypto/PublicKey/ElGamal.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- ElGamal.py	28 Feb 2003 15:25:09 -0000	1.6
+++ ElGamal.py	3 Apr 2003 20:36:12 -0000	1.7
@@ -106,7 +106,7 @@
         while (power<self.p): bits, power = bits+1, power<<1
         return bits-1
 
-    def hasprivate(self):
+    def has_private(self):
         """Return a Boolean denoting whether the object contains
         private components."""
         if hasattr(self, 'x'): return 1

Index: RSA.py
===================================================================
RCS file: /cvsroot/pycrypto/crypto/PublicKey/RSA.py,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- RSA.py	3 Apr 2003 20:30:00 -0000	1.14
+++ RSA.py	3 Apr 2003 20:36:13 -0000	1.15
@@ -108,8 +108,8 @@
         while (power<self.n): bits, power = bits+1, power<<1
         return bits-1
 
-    def hasprivate(self):
-        """hasprivate() : bool
+    def has_private(self):
+        """has_private() : bool
         Return a Boolean denoting whether the object contains
         private components.
         """
@@ -180,8 +180,8 @@
     def size(self):
         return self.key.size()
 
-    def hasprivate(self):
-        return self.key.hasprivate()
+    def has_private(self):
+        return self.key.has_private()
 
     def publickey(self):
         return construct_c((self.key.n, self.key.e))

Index: pubkey.py
===================================================================
RCS file: /cvsroot/pycrypto/crypto/PublicKey/pubkey.py,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- pubkey.py	3 Apr 2003 20:30:00 -0000	1.10
+++ pubkey.py	3 Apr 2003 20:36:14 -0000	1.11
@@ -69,7 +69,7 @@
         Return a tuple containing the signature for the message M.
         K is a random parameter required by some algorithms.
         """
-        if (not self.hasprivate()):
+        if (not self.has_private()):
             raise error, 'Private key not available in this object'
         if isinstance(M, types.StringType): M=bytes_to_long(M)
         if isinstance(K, types.StringType): K=bytes_to_long(K)
@@ -116,8 +116,8 @@
     # The following methods will usually be left alone, except for
     # signature-only algorithms.  They both return Boolean values
     # recording whether this key's algorithm can sign and encrypt.
-    def cansign (self):
-        """cansign() : bool
+    def can_sign (self):
+        """can_sign() : bool
         Return a Boolean value recording whether this algorithm can
         generate signatures.  (This does not imply that this
         particular key object has the private information required to
@@ -125,8 +125,8 @@
         """
         return 1
 
-    def canencrypt (self):
-        """canencrypt() : bool
+    def can_encrypt (self):
+        """can_encrypt() : bool
         Return a Boolean value recording whether this algorithm can
         encrypt data.  (This does not imply that this
         particular key object has the private information required to
@@ -152,8 +152,8 @@
         """
         return 0
 
-    def hasprivate (self):
-        """hasprivate() : bool
+    def has_private (self):
+        """has_private() : bool
         Return a Boolean denoting whether the object contains
         private components.
         """

Index: qNEW.py
===================================================================
RCS file: /cvsroot/pycrypto/crypto/PublicKey/qNEW.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- qNEW.py	28 Feb 2003 15:25:13 -0000	1.6
+++ qNEW.py	3 Apr 2003 20:36:14 -0000	1.7
@@ -138,15 +138,15 @@
         "Return the maximum number of bits that can be handled by this key."
         return 160
 
-    def hasprivate(self):
+    def has_private(self):
         """Return a Boolean denoting whether the object contains
         private components."""
         return hasattr(self, 'x')
 
-    def cansign(self):
+    def can_sign(self):
         """Return a Boolean value recording whether this algorithm can generate signatures."""
         return 1
-    def canencrypt(self):
+    def can_encrypt(self):
         """Return a Boolean value recording whether this algorithm can encrypt data."""
         return 0
 



-------------------------------------------------------
This SF.net email is sponsored by: ValueWeb: 
Dedicated Hosting for just $79/mo with 500 GB of bandwidth! 
No other company gives more support or power for your dedicated server
http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/