diff options
author | lloyd <[email protected]> | 2010-10-12 19:59:26 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-10-12 19:59:26 +0000 |
commit | 39306575081f043d1c79ade43797d3595fd5aeec (patch) | |
tree | 926b8833f6cbde9f929b2b6156fd27b5d69f5266 /src/pubkey/gost_3410/gost_3410.cpp | |
parent | a85f136550c08fc878e3983866af0e6460e980da (diff) |
Use size_t instead of u32bit in all of pubkey
Diffstat (limited to 'src/pubkey/gost_3410/gost_3410.cpp')
-rw-r--r-- | src/pubkey/gost_3410/gost_3410.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/pubkey/gost_3410/gost_3410.cpp b/src/pubkey/gost_3410/gost_3410.cpp index 50878634b..61693e01f 100644 --- a/src/pubkey/gost_3410/gost_3410.cpp +++ b/src/pubkey/gost_3410/gost_3410.cpp @@ -20,7 +20,7 @@ MemoryVector<byte> GOST_3410_PublicKey::x509_subject_public_key() const const BigInt& x = public_point().get_affine_x(); const BigInt& y = public_point().get_affine_y(); - u32bit part_size = std::max(x.bytes(), y.bytes()); + size_t part_size = std::max(x.bytes(), y.bytes()); MemoryVector<byte> bits(2*part_size); @@ -28,7 +28,7 @@ MemoryVector<byte> GOST_3410_PublicKey::x509_subject_public_key() const y.binary_encode(&bits[2*part_size - y.bytes()]); // Keys are stored in little endian format (WTF) - for(u32bit i = 0; i != part_size / 2; ++i) + for(size_t i = 0; i != part_size / 2; ++i) { std::swap(bits[i], bits[part_size-1-i]); std::swap(bits[part_size+i], bits[2*part_size-1-i]); @@ -61,10 +61,10 @@ GOST_3410_PublicKey::GOST_3410_PublicKey(const AlgorithmIdentifier& alg_id, SecureVector<byte> bits; BER_Decoder(key_bits).decode(bits, OCTET_STRING); - const u32bit part_size = bits.size() / 2; + const size_t part_size = bits.size() / 2; // Keys are stored in little endian format (WTF) - for(u32bit i = 0; i != part_size / 2; ++i) + for(size_t i = 0; i != part_size / 2; ++i) { std::swap(bits[i], bits[part_size-1-i]); std::swap(bits[part_size+i], bits[2*part_size-1-i]); @@ -81,7 +81,7 @@ GOST_3410_PublicKey::GOST_3410_PublicKey(const AlgorithmIdentifier& alg_id, namespace { -BigInt decode_le(const byte msg[], u32bit msg_len) +BigInt decode_le(const byte msg[], size_t msg_len) { SecureVector<byte> msg_le(msg, msg_len); @@ -103,7 +103,7 @@ GOST_3410_Signature_Operation::GOST_3410_Signature_Operation( } SecureVector<byte> -GOST_3410_Signature_Operation::sign(const byte msg[], u32bit msg_len, +GOST_3410_Signature_Operation::sign(const byte msg[], size_t msg_len, RandomNumberGenerator& rng) { BigInt k; @@ -142,8 +142,8 @@ GOST_3410_Verification_Operation::GOST_3410_Verification_Operation(const GOST_34 { } -bool GOST_3410_Verification_Operation::verify(const byte msg[], u32bit msg_len, - const byte sig[], u32bit sig_len) +bool GOST_3410_Verification_Operation::verify(const byte msg[], size_t msg_len, + const byte sig[], size_t sig_len) { if(sig_len != order.bytes()*2) return false; |