[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: kdesupport/qca/src/botantools/botan
From: Justin Karneges <infiniti () affinix ! com>
Date: 2004-10-28 1:35:37
Message-ID: 20041028013537.69BC416C13 () office ! kde ! org
[Download RAW message or body]
CVS commit by infiniti:
zero out unused data when encoding
M +8 -0 big_code.cpp 1.4
--- kdesupport/qca/src/botantools/botan/big_code.cpp #1.3:1.4
@@ -84,7 +84,15 @@ void BigInt::encode(byte output[], const
output[output_size - 1 - j] = digit2char(remainder.word_at(0));
if(copy.is_zero())
+ {
+ if(j < output_size - 1)
+ {
+ int extra = output_size - 1 - j;
+ memmove(output, output + extra, output_size - extra);
+ memset(output + output_size - extra, 0, extra);
+ }
break;
}
}
+ }
else
throw Invalid_Argument("Unknown BigInt encoding method");
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic