1 |
/* SecureRandom.java --- Secure Random class implmentation |
/* SecureRandom.java --- Secure Random class implmentation |
2 |
Copyright (C) 1999, 2001, 2002 Free Software Foundation, Inc. |
Copyright (C) 1999, 2001, 2002, 2003 Free Software Foundation, Inc. |
3 |
|
|
4 |
This file is part of GNU Classpath. |
This file is part of GNU Classpath. |
5 |
|
|
36 |
exception statement from your version. */ |
exception statement from your version. */ |
37 |
|
|
38 |
package java.security; |
package java.security; |
39 |
|
|
40 |
import java.io.Serializable; |
import java.io.Serializable; |
41 |
import java.util.Random; |
import java.util.Random; |
42 |
import java.util.Enumeration; |
import java.util.Enumeration; |
359 |
int ret = 0; |
int ret = 0; |
360 |
|
|
361 |
for (int i = 0; i < tmp.length; i++) |
for (int i = 0; i < tmp.length; i++) |
362 |
ret |= tmp[i] << (8 * i); |
ret |= (tmp[i] & 0xFF) << (8 * i); |
363 |
|
|
364 |
return ret; |
long mask = (1L << numBits) - 1; |
365 |
|
return (int) (ret & mask); |
366 |
} |
} |
367 |
|
|
368 |
/** |
/** |