Changeset 2801 for source/ariba
- Timestamp:
- Apr 16, 2009, 10:43:02 AM (16 years ago)
- Location:
- source/ariba/utility
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
source/ariba/utility/misc/KeyMapping.hpp
r2800 r2801 69 69 public: 70 70 inline KeyMapping(){ 71 srand( time(0));71 srand( time(NULL) ); 72 72 } 73 73 -
source/ariba/utility/system/StartupWrapper.cpp
r2800 r2801 78 78 if( initialized ) return; 79 79 initialized = true; 80 81 // 82 // having seeded the pseudo rng is always good 83 // 84 85 srand( time(NULL) ); 80 86 81 87 // -
source/ariba/utility/types/Identifier.cpp
r2457 r2801 598 598 599 599 //as mpn_random has no seeding function 600 // we mess aroung here a little to achive randomness 600 // we mess aroung here a little to achive some randomness 601 // using the rand function that _is_ seeded in the 602 // StartupWrapper::initSystem function 603 601 604 Identifier keyRandom = ZERO; 602 605 mpn_random(keyRandom.key, aSize); 603 Identifier key Time( time(NULL) );604 mpn_mul_1( newKey.key, keyRandom.key, aSize, *key Time.key );606 Identifier keyrnd( rand() ); 607 mpn_mul_1( newKey.key, keyRandom.key, aSize, *keyrnd.key ); 605 608 606 609 newKey.trim(); … … 608 611 } 609 612 610 611 // README: due to some problems with serialization the keylength612 // was changed to 192 bit! As none of the hashing functions613 // can provide 160 bit output, and we currently don't use any614 // hashing for identifiers in the demo at all ... this is all commented out!!615 616 617 // generate sha1 hash618 613 Identifier Identifier::sha1(const string& input) { 619 614 Identifier newKey; … … 652 647 } 653 648 654 655 656 649 // generate a key=2**exponent 657 650 Identifier Identifier::pow2(uint exponent) {
Note:
See TracChangeset
for help on using the changeset viewer.