Changeset 2801 for source/ariba/utility/types
- Timestamp:
- Apr 16, 2009, 10:43:02 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.