Android Reference
SHA1PRNG_SecureRandomImpl
org.apache.harmony.security.provider.crypto
Class SHA1PRNG_SecureRandomImpl
-
- All Implemented Interfaces:
- Serializable, SHA1_Data
public class SHA1PRNG_SecureRandomImpl
extends SecureRandomSpi
implements Serializable, SHA1_Data
This class extends the SecureRandomSpi class implementing all its abstract methods.
To generate pseudo-random bits, the implementation uses technique described in
the "Random Number Generator (RNG) algorithms" section, Appendix A,
JavaTM Cryptography Architecture, API Specification&Reference
The class implements the Serializable interface.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors
Constructor and Description |
SHA1PRNG_SecureRandomImpl()
Creates object and sets implementation variables to their initial values
|
-
Method Summary
Methods
Modifier and Type |
Method and Description |
protected byte[] |
engineGenerateSeed(int numBytes)
Returns a required number of random bytes.
|
protected void |
engineNextBytes(byte[] bytes)
Writes random bytes into an array supplied.
|
protected void |
engineSetSeed(byte[] seed)
Changes current seed by supplementing a seed argument to the current seed,
if this already set;
the argument is used as first seed otherwise.
|
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
engineSetSeed
protected void engineSetSeed(byte[] seed)
Changes current seed by supplementing a seed argument to the current seed,
if this already set;
the argument is used as first seed otherwise.
The method overrides "engineSetSeed(byte[])" in class SecureRandomSpi.
- Specified by:
engineSetSeed
in class SecureRandomSpi
- Parameters:
seed
- - byte array
- Throws:
NullPointerException
- - if null is passed to the "seed" argument
-
engineNextBytes
protected void engineNextBytes(byte[] bytes)
Writes random bytes into an array supplied.
Bits in a byte are from left to right.
To generate random bytes, the "expansion of source bits" method is used,
that is,
the current seed with a 64-bit counter appended is used to compute new bits.
The counter is incremented by 1 for each 20-byte output.
The method overrides engineNextBytes in class SecureRandomSpi.
- Specified by:
engineNextBytes
in class SecureRandomSpi
- Parameters:
bytes
- - byte array to be filled in with bytes
- Throws:
NullPointerException
- - if null is passed to the "bytes" argument
Content
License.
All information of this service is derived from the free sources and is provided solely in the form of quotations.
This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 126 / 158777649. Delta: 0.03111 с