Merge pull request #16 from TheQuantumPhysicist/master

Fixed a few warnings about signed and unsigned comparison.
This commit is contained in:
Arun Muralidharan 2018-05-19 21:54:49 +05:30 committed by GitHub
commit 0227be3445
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View file

@ -94,7 +94,7 @@ std::string base64_encode(const char* in, size_t len)
int i = 0;
int j = 0;
for (; i < len - 2; i += 3) {
for (; i < static_cast<int>(len) - 2; i += 3) {
const auto first = in[i];
const auto second = in[i+1];
const auto third = in[i+2];

View file

@ -306,9 +306,9 @@ std::string PEMSign<Hasher>::public_key_ser(
ECDSA_SIG_get0(ec_sig.get(), &ec_sig_r, &ec_sig_s);
auto r_len = BN_num_bytes(ec_sig_r);
auto s_len = BN_num_bytes(ec_sig_s);
auto bn_len = (degree + 7) / 8;
int r_len = BN_num_bytes(ec_sig_r);
int s_len = BN_num_bytes(ec_sig_s);
int bn_len = static_cast<int>((degree + 7) / 8);
if ((r_len > bn_len) || (s_len > bn_len)) {
ec = AlgorithmErrc::SigningErr;