aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Smeding <hallo@tomsmeding.nl>2016-10-28 00:20:21 +0200
committertomsmeding <tom.smeding@gmail.com>2016-10-28 00:22:18 +0200
commitf19210d6696efe118c5bb7906cdedc61bde9ff7c (patch)
treeacc3d0d3cae30cd6095edeacfb3f0f46f12dc544
parente844beecc86dafca3e49b2ab2986c118e38ef1a4 (diff)
Fix int type in rsa.cpp
-rw-r--r--rsa.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/rsa.cpp b/rsa.cpp
index 21d252f..ba75e42 100644
--- a/rsa.cpp
+++ b/rsa.cpp
@@ -50,8 +50,8 @@ namespace RSA{
Key importKey(const string &repr){
string deser=Base64::decode(repr);
if(deser.size()<=4)throw invalid_argument("Invalid key string length");
- int modlen=((uint8_t)deser[0]<<24)+((uint8_t)deser[1]<<16)+
- ((uint8_t)deser[2]<<8)+(uint8_t)deser[3];
+ int32_t modlen=((uint8_t)deser[0]<<24)+((uint8_t)deser[1]<<16)+
+ ((uint8_t)deser[2]<<8)+(uint8_t)deser[3];
if((int)deser.size()-4-modlen<=0)throw invalid_argument("Key string incomplete");
Key key;
key.mod.deserialiseMantissa(string(deser.begin()+4,deser.begin()+(4+modlen)));