From ce60836ac490f50deab372ef93b969f4178516ac Mon Sep 17 00:00:00 2001 From: JoelKatz Date: Fri, 18 May 2012 19:45:55 -0700 Subject: [PATCH] Allow signatures, public keys, and private keys to vary in length. If this breaks anything, we'll fix it. --- src/key.h | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/key.h b/src/key.h index c563fbfa3..e7c5a3e8a 100644 --- a/src/key.h +++ b/src/key.h @@ -218,7 +218,6 @@ public: if (i2d_ECPrivateKey(pkey, &pbegin) != nSize) throw key_error("CKey::GetPrivKey() : i2d_ECPrivateKey returned unexpected size"); assert(vchPrivKey.size()<=279); - while(vchPrivKey.size()<279) vchPrivKey.push_back((unsigned char)0); return vchPrivKey; } @@ -243,7 +242,6 @@ public: if (i2o_ECPublicKey(pkey, &pbegin) != nSize) throw key_error("CKey::GetPubKey() : i2o_ECPublicKey returned unexpected size"); assert(vchPubKey.size()<=33); - while(vchPubKey.size()<33) vchPubKey.push_back((unsigned char)0); return vchPubKey; } @@ -255,12 +253,6 @@ public: if (!ECDSA_sign(0, (unsigned char*)&hash, sizeof(hash), pchSig, &nSize, pkey)) return false; - while(nSize<72) - { // enlarge to 72 bytes - pchSig[nSize]=0; - nSize++; - } - assert(nSize==72); vchSig.resize(nSize); memcpy(&vchSig[0], pchSig, nSize); return true;