diff options
author | lloyd <[email protected]> | 2010-10-12 20:23:47 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-10-12 20:23:47 +0000 |
commit | 6385602fcccfd9c561b1c097095ddd2edf1a2357 (patch) | |
tree | 63374ebafd20b09ff4ad77d624a4b27c87b1062c /src/entropy/cryptoapi_rng | |
parent | ab1f661083053df745daf1e1b8f4859f5a92065d (diff) |
Use size_t instead of u32bit in entropy and rng
Diffstat (limited to 'src/entropy/cryptoapi_rng')
-rw-r--r-- | src/entropy/cryptoapi_rng/es_capi.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/entropy/cryptoapi_rng/es_capi.cpp b/src/entropy/cryptoapi_rng/es_capi.cpp index f3a94ad34..1de76dabb 100644 --- a/src/entropy/cryptoapi_rng/es_capi.cpp +++ b/src/entropy/cryptoapi_rng/es_capi.cpp @@ -33,7 +33,7 @@ class CSP_Handle CryptReleaseContext(handle, 0); } - u32bit gen_random(byte out[], u32bit n) const + size_t gen_random(byte out[], size_t n) const { if(is_valid() && CryptGenRandom(handle, n, out)) return n; @@ -57,11 +57,11 @@ void Win32_CAPI_EntropySource::poll(Entropy_Accumulator& accum) { MemoryRegion<byte>& io_buffer = accum.get_io_buffer(32); - for(u32bit j = 0; j != prov_types.size(); ++j) + for(size_t i = 0; i != prov_types.size(); ++i) { - CSP_Handle csp(prov_types[j]); + CSP_Handle csp(prov_types[i]); - u32bit got = csp.gen_random(&io_buffer[0], io_buffer.size()); + size_t got = csp.gen_random(&io_buffer[0], io_buffer.size()); if(got) { @@ -78,12 +78,12 @@ Win32_CAPI_EntropySource::Win32_CAPI_EntropySource(const std::string& provs) { std::vector<std::string> capi_provs = split_on(provs, ':'); - for(u32bit j = 0; j != capi_provs.size(); ++j) + for(size_t i = 0; i != capi_provs.size(); ++i) { - if(capi_provs[j] == "RSA_FULL") prov_types.push_back(PROV_RSA_FULL); - if(capi_provs[j] == "INTEL_SEC") prov_types.push_back(PROV_INTEL_SEC); - if(capi_provs[j] == "FORTEZZA") prov_types.push_back(PROV_FORTEZZA); - if(capi_provs[j] == "RNG") prov_types.push_back(PROV_RNG); + if(capi_provs[i] == "RSA_FULL") prov_types.push_back(PROV_RSA_FULL); + if(capi_provs[i] == "INTEL_SEC") prov_types.push_back(PROV_INTEL_SEC); + if(capi_provs[i] == "FORTEZZA") prov_types.push_back(PROV_FORTEZZA); + if(capi_provs[i] == "RNG") prov_types.push_back(PROV_RNG); } if(prov_types.size() == 0) |