]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
fixed funny hash output thingy
authoranwleung <anwleung@29311d96-e01e-0410-9327-a35deaab8ce9>
Fri, 9 Mar 2007 20:25:47 +0000 (20:25 +0000)
committeranwleung <anwleung@29311d96-e01e-0410-9327-a35deaab8ce9>
Fri, 9 Mar 2007 20:25:47 +0000 (20:25 +0000)
git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@1191 29311d96-e01e-0410-9327-a35deaab8ce9

branches/aleung/security1/ceph/crypto/CryptoLib.h
branches/aleung/security1/ceph/crypto/Makefile
branches/aleung/security1/ceph/crypto/MerkleTree.h
branches/aleung/security1/ceph/crypto/driver.cc

index 9763a5c4a2cc1d6071771f8f7fa4ec542b1eb20e..4df11d8430449fe172e970d43fa19e4a95cd7391 100644 (file)
@@ -67,7 +67,6 @@ namespace CryptoLib {
   cfbRC5Dec getRC5Dec(byte*, const unsigned int, byte*);
   void encryptRC5(byte*, const unsigned int, byte*, cfbRC5Enc);
   void decryptRC5(byte*, const unsigned int, byte*, cfbRC5Dec);
-  
 
   // asymmetric key generation
   esignPriv esignPrivKey(char*);
index 1c3f3c5ae3952d516a9cbf6f23124b2b028be348..24f1113669a82f84b59ac9ee2a3884190d839850 100644 (file)
@@ -41,4 +41,4 @@ clean:
 
 depend:
        $(RM) .depend
-       makedepend -f- -- $(CFLAGS) -- $(SRCS) > .depend 2>/dev/null
\ No newline at end of file
+       makedepend -f- -- $(CFLAGS) -- $(SRCS) > .depend 2>/dev/null
index a011e93db4dc44e02bf36e2a01a0aaa68197b6bd..35b21bbdb900c8025eff5ddd6d110de0fb2ea49b 100644 (file)
@@ -43,7 +43,7 @@ inline std::ostream& operator<<(std::ostream& out, const hash_t& c)
   byte hexArray[2*SHA1DIGESTSIZE];
   memset(hexArray, 0x00, sizeof(hexArray));
   toHex(c.val, hexArray, SHA1DIGESTSIZE, 2*SHA1DIGESTSIZE);
-  out << string((const char*)hexArray);
+  out << string((const char*)hexArray, sizeof(hexArray));
   return out;
 }
 
index a13222d7e83a30d8fa826f73ee2b89a79ab4b460..0e8a12bd5f7e7fbe193124bb9f7b39118d590f2e 100644 (file)
@@ -43,7 +43,7 @@ int main(int argc, char* argv[]) {
   sha1(msg,digest,strlen((const char*)msg));
   toHex(digest, digestHex, SHA1DIGESTSIZE, 2*SHA1DIGESTSIZE);
   cout << "SHA-1 of " << msg << " is " << string((const char*)digestHex,2*SHA1DIGESTSIZE) << endl;
-
   // sha-256
   byte digest256[SHA256DIGESTSIZE];
   byte hex256[2*SHA256DIGESTSIZE];