[Pkg] The Trunk: System-nice.401.mcz

commits at source.squeak.org commits at source.squeak.org
Tue Dec 14 14:36:11 UTC 2010


Nicolas Cellier uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-nice.401.mcz

==================== Summary ====================

Name: System-nice.401
Author: nice
Time: 14 December 2010, 3:35:52.364 pm
UUID: d80cdabe-2a2d-4648-b373-3011b5148dc6
Ancestors: System-ul.400

Normalize some LargePositiveInteger created with #new:

=============== Diff against System-ul.400 ===============

Item was changed:
  ----- Method: DigitalSignatureAlgorithm>>initRandomFromString: (in category 'initialization') -----
  initRandomFromString: aString
  	"Ask the user to type a long random string and use the result to seed the secure random number generator."
  
  	| s k srcIndex |
  	s := aString.
  	k := LargePositiveInteger new: (s size min: 64).
  	srcIndex := 0.
  	k digitLength to: 1 by: -1 do: [:i |
  		k digitAt: i put: (s at: (srcIndex := srcIndex + 1)) asciiValue].
+ 	k := k normalize + (Random new next * 16r7FFFFFFF) asInteger.  "a few additional bits randomness"
- 	k := k + (Random new next * 16r7FFFFFFF) asInteger.  "a few additional bits randomness"
  	k highBit > 512 ifTrue: [k := k bitShift: k highBit - 512].
  	self initRandom: k.
  !

Item was changed:
  ----- Method: DigitalSignatureAlgorithm>>initRandomFromUser (in category 'initialization') -----
  initRandomFromUser
  	"Ask the user to type a long random string and use the result to seed the secure random number generator."
  
  	| s k srcIndex |
  	s := UIManager default request: 'Enter a long random string to seed the random generator.'.
  	k := LargePositiveInteger new: (s size min: 64).
  	srcIndex := 0.
  	k digitLength to: 1 by: -1 do: [:i |
  		k digitAt: i put: (s at: (srcIndex := srcIndex + 1)) asciiValue].
+ 	k := k normalize + (Random new next * 16r7FFFFFFF) asInteger.  "a few additional bits randomness"
- 	k := k + (Random new next * 16r7FFFFFFF) asInteger.  "a few additional bits randomness"
  	k highBit > 512 ifTrue: [k := k bitShift: k highBit - 512].
  	self initRandom: k.
  !



More information about the Packages mailing list