RandomRDRand.st
author Claus Gittinger <cg@exept.de>
Sat, 23 Mar 2019 11:48:07 +0100
changeset 4896 17bbef385be1
parent 4887 8c49f1189e7c
child 4925 3b6b894d2664
permissions -rw-r--r--
#TUNING by cg class: CRCStream changed: #nextPutBytes:from:startingAt:
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4598
409af0c80e09 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4595
diff changeset
     1
"{ Encoding: utf8 }"
409af0c80e09 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4595
diff changeset
     2
4322
97661b0035ed #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
     3
"
97661b0035ed #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
     4
 COPYRIGHT (c) 2014 Claus Gittinger
4667
35e1ebb8020e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4598
diff changeset
     5
	      All Rights Reserved
4322
97661b0035ed #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
     6
97661b0035ed #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
     7
 This software is furnished under a license and may be used
97661b0035ed #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
     8
 only in accordance with the terms of that license and with the
97661b0035ed #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
     9
 inclusion of the above copyright notice.   This software may not
97661b0035ed #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
    10
 be provided or otherwise made available to, or used by, any
97661b0035ed #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
    11
 other person.  No title to or ownership of the software is
97661b0035ed #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
    12
 hereby transferred.
97661b0035ed #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
    13
"
3405
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
"{ Package: 'stx:libbasic2' }"
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
4322
97661b0035ed #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
    16
"{ NameSpace: Smalltalk }"
97661b0035ed #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
    17
3405
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
Object subclass:#RandomRDRand
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
	instanceVariableNames:'x y z c'
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
	classVariableNames:''
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
	poolDictionaries:''
4595
39b2f30679c0 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4322
diff changeset
    22
	category:'Magnitude-Numbers-Random'
3405
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
!
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
!RandomRDRand class methodsFor:'documentation'!
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
4322
97661b0035ed #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
    27
copyright
97661b0035ed #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
    28
"
97661b0035ed #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
    29
 COPYRIGHT (c) 2014 Claus Gittinger
4667
35e1ebb8020e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4598
diff changeset
    30
	      All Rights Reserved
4322
97661b0035ed #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
    31
97661b0035ed #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
    32
 This software is furnished under a license and may be used
97661b0035ed #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
    33
 only in accordance with the terms of that license and with the
97661b0035ed #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
    34
 inclusion of the above copyright notice.   This software may not
97661b0035ed #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
    35
 be provided or otherwise made available to, or used by, any
97661b0035ed #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
    36
 other person.  No title to or ownership of the software is
97661b0035ed #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
    37
 hereby transferred.
97661b0035ed #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
    38
"
97661b0035ed #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
    39
!
97661b0035ed #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
    40
3405
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
documentation
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
"
4598
409af0c80e09 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4595
diff changeset
    43
    This generator uses the rdgen random generator which is built into modern intel chips.
409af0c80e09 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4595
diff changeset
    44
    Before using, you should check via the isSupported query.
409af0c80e09 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4595
diff changeset
    45
4667
35e1ebb8020e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4598
diff changeset
    46
    Warning:
35e1ebb8020e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4598
diff changeset
    47
	there have been discussions about the security of the intel rdgen instruction
35e1ebb8020e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4598
diff changeset
    48
	and whether there are NSA backdoors built into it.
35e1ebb8020e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4598
diff changeset
    49
	Linus Torwalds refuses to use it for /dev/urandom in the linux kernel, for that very reason.
35e1ebb8020e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4598
diff changeset
    50
	Be sure you know what you are doing, if you use this generator for sensitive cryptographic stuff.
35e1ebb8020e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4598
diff changeset
    51
	We recommend using one of the libcrypt-based generators and use this only to get additional
35e1ebb8020e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4598
diff changeset
    52
	entropy for the seed.
3405
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
    NO WARRANTY
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
    RandomRDGen new nextInteger
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
    [see also:]
4667
35e1ebb8020e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4598
diff changeset
    59
	RandomGenerator - the default; uses the machine's /dev/random if available
35e1ebb8020e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4598
diff changeset
    60
	Random  - fast, but generates less quality random numbers
35e1ebb8020e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4598
diff changeset
    61
	RandomTT800 - another random generator
35e1ebb8020e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4598
diff changeset
    62
	RandomParkMiller - another random generator
35e1ebb8020e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4598
diff changeset
    63
	RandomMT19937 - another random generator
35e1ebb8020e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4598
diff changeset
    64
	RandomKISS - another random generator
35e1ebb8020e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4598
diff changeset
    65
	exept:libcrypt - a library containing more stuff based on hashes and cyphers
3405
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
    [author:]
4667
35e1ebb8020e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4598
diff changeset
    68
	Claus Gittinger.
3405
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
"
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    70
! !
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
!RandomRDRand class methodsFor:'instance creation'!
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
new
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
    self isSupported ifFalse:[ self error:'this generator needs a cpu with rdgen instruction' ].
4598
409af0c80e09 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4595
diff changeset
    76
    ^ self basicNew initialize
409af0c80e09 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4595
diff changeset
    77
409af0c80e09 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4595
diff changeset
    78
    "
409af0c80e09 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4595
diff changeset
    79
     self new nextInteger
409af0c80e09 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4595
diff changeset
    80
    "
3405
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    81
!
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    82
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    83
new:seed
4598
409af0c80e09 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4595
diff changeset
    84
    "seed is actually ignored"
3405
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    85
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    86
    self isSupported ifFalse:[ self error:'this generator needs a cpu with rdgen instruction' ].
4598
409af0c80e09 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4595
diff changeset
    87
    ^ self basicNew initialize; seed:seed
3405
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    88
! !
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    89
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    90
!RandomRDRand class methodsFor:'queries'!
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    91
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    92
isSupported
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    93
    "true if this architecture supports hardware random numbers"
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    94
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    95
    ^ OperatingSystem getCPUType = 'x86_64'
4667
35e1ebb8020e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4598
diff changeset
    96
	and:[ (OperatingSystem getSystemInfo at:#extendedInstructions ifAbsent:#())
35e1ebb8020e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4598
diff changeset
    97
	      includes:#aes ]
3405
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    98
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    99
    "
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   100
     self isSupported
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   101
    "
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   102
! !
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   103
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   104
!RandomRDRand methodsFor:'initialization'!
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   105
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   106
initialize
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   107
!
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   108
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   109
seed:seed
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   110
    "/ ignored
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   111
! !
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   112
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   113
!RandomRDRand methodsFor:'random numbers'!
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   114
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   115
nextBoolean
3416
a71369580f84 comments
Claus Gittinger <cg@exept.de>
parents: 3405
diff changeset
   116
    "generates a boolean random"
3405
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   117
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   118
    ^ self nextInteger > 16r7FFFFFFF
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   119
!
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   120
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   121
nextInteger
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   122
    "generates the next integer in 0..FFFFFFFF.
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   123
     Notice, it may raise an illegal instruction exception on some cpu chips,
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   124
     even though the cpuid instruction says that it is available"
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   125
4667
35e1ebb8020e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4598
diff changeset
   126
    |cfStillSet|
35e1ebb8020e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4598
diff changeset
   127
3405
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   128
%{
4598
409af0c80e09 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4595
diff changeset
   129
    unsigned INT r = 0;
3405
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   130
    int cf;
4667
35e1ebb8020e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4598
diff changeset
   131
    int count = 50;
3405
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   132
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   133
    do {
4598
409af0c80e09 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4595
diff changeset
   134
#ifdef USE_DRAND64
4887
8c49f1189e7c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
   135
        cf = _rdrand64_step(&r);
3405
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   136
#else
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   137
# ifdef USE_DRAND32
4887
8c49f1189e7c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
   138
        cf = _rdrand32_step(&r);
3405
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   139
# else
4598
409af0c80e09 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4595
diff changeset
   140
#  if defined(__x86__) && defined(__GNUC__) && (__GNUC__ >= 2)
4887
8c49f1189e7c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
   141
        // Encoding of rdrand %eax
8c49f1189e7c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
   142
        asm(".byte 0x0F, 0xC7, 0xF0; adcl $0,%1"
8c49f1189e7c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
   143
            : "=a" (r), "=r" (cf)
8c49f1189e7c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
   144
            : "0" (r), "1" (cf)
8c49f1189e7c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
   145
            : "cc");
4598
409af0c80e09 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4595
diff changeset
   146
409af0c80e09 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4595
diff changeset
   147
#  else
4667
35e1ebb8020e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4598
diff changeset
   148
#   if defined(__x86_64__) && defined(__GNUC__) && (__GNUC__ >= 2)
4887
8c49f1189e7c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
   149
        // Encoding of rdrand %rax
8c49f1189e7c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
   150
        asm(".byte 0x48, 0x0F, 0xC7, 0xF0; adcl $0,%1"
8c49f1189e7c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
   151
            : "=a" (r), "=r" (cf)
8c49f1189e7c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
   152
            : "0" (r), "1" (cf)
8c49f1189e7c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
   153
            : "cc");
4667
35e1ebb8020e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4598
diff changeset
   154
35e1ebb8020e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4598
diff changeset
   155
#   else
4887
8c49f1189e7c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
   156
        goto unsupported;
4667
35e1ebb8020e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4598
diff changeset
   157
#   endif
4598
409af0c80e09 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4595
diff changeset
   158
#  endif
3405
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   159
# endif
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   160
#endif
4667
35e1ebb8020e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4598
diff changeset
   161
    } while ((cf != 0) && (--count > 0));
35e1ebb8020e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4598
diff changeset
   162
    if (cf == 0) {
4887
8c49f1189e7c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
   163
        RETURN (__MKUINT(r));
4667
35e1ebb8020e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4598
diff changeset
   164
    }
35e1ebb8020e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4598
diff changeset
   165
    cfStillSet = true;
3405
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   166
unsupported: ;
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   167
%}.
4887
8c49f1189e7c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
   168
    cfStillSet == true ifTrue:[
8c49f1189e7c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
   169
        self primitiveFailed:'carry flag not clear after 50 tries'
4667
35e1ebb8020e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4598
diff changeset
   170
    ].
3405
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   171
    self primitiveFailed:'unsupported on this architecture'
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   172
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   173
    "
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   174
     self new nextInteger
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   175
    "
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   176
! !
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   177
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   178
!RandomRDRand class methodsFor:'documentation'!
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   179
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   180
version
4322
97661b0035ed #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
   181
    ^ '$Header$'
3405
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   182
!
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   183
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   184
version_CVS
4322
97661b0035ed #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
   185
    ^ '$Header$'
3405
84393adea27c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   186
! !
4887
8c49f1189e7c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
   187