iaik.pkcs.pkcs1
Class MaskGenerationAlgorithmSpi

java.lang.Object
  |
  +--iaik.pkcs.pkcs1.MaskGenerationAlgorithmSpi
Direct Known Subclasses:
MaskGenerationAlgorithm

public abstract class MaskGenerationAlgorithmSpi
extends Object

JCA compliant SPI class that provides the functionality of a PKCS#1v2.1 mask generation function.

Mask generation functions are used by the PKCS#1v2.1 PSS signature and OAEP encryption schemes:

 A mask generation function takes an octet string of variable length
 and a desired output length as input, and outputs an octet string of
 the desired length.  There may be restrictions on the length of the
 input and output octet strings, but such bounds are generally very
 large.  Mask generation functions are deterministic; the octet string
 output is completely determined by the input octet string.  The
 output of a mask generation function should be pseudorandom: Given
 one part of the output but not the input, it should be infeasible to
 predict another part of the output.  The provable security of RSAES-
 OAEP and RSASSA-PSS relies on the random nature of the output of the
 mask generation function, which in turn relies on the random nature
 of the underlying hash.
 

Version:
File Revision 8
See Also:
MaskGenerationAlgorithm

Constructor Summary
protected MaskGenerationAlgorithmSpi()
          Default constructor.
 
Method Summary
 Object clone()
          Returns a clone if the implementation is cloneable.
protected abstract  AlgorithmParameters engineGetParameters()
          SPI: Gets the algorithm parameters required by this MGF engine.
protected abstract  void engineMask(byte[] mgfSeed, int mgfSeedOff, int mgfSeedLen, int maskLen, byte[] dst, int dstOff)
          SPI: Uses the mask generation function to generate maskLen bytes from the supplied seed mgfSeed[mgfSeedOff:mgfSeedLen] and XORs the result with dst[off:maskLen].
protected abstract  void engineReset()
          SPE: Resets this engine to the state before engineMask has been called.
protected abstract  void engineSetParameters(AlgorithmParameters params)
          SPI: Sets any algorithm parameters required by this MGF engine.
protected abstract  void engineSetParameters(AlgorithmParameterSpec paramSpec)
          SPI: Sets any algorithm parameters required by this MGF engine.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MaskGenerationAlgorithmSpi

protected MaskGenerationAlgorithmSpi()
Default constructor.
Method Detail

engineSetParameters

protected abstract void engineSetParameters(AlgorithmParameterSpec paramSpec)
                                     throws InvalidAlgorithmParameterException
SPI: Sets any algorithm parameters required by this MGF engine.
Parameters:
paramSpec - the parameters to be set
Throws:
InvalidAlgorithmParameterException - if the parameters are inappropriate for this engine or are invalid

engineSetParameters

protected abstract void engineSetParameters(AlgorithmParameters params)
                                     throws InvalidAlgorithmParameterException
SPI: Sets any algorithm parameters required by this MGF engine.
Parameters:
params - the parameters to be set
Throws:
InvalidAlgorithmParameterException - if the parameters are inappropriate for this engine or are invalid

engineGetParameters

protected abstract AlgorithmParameters engineGetParameters()
SPI: Gets the algorithm parameters required by this MGF engine.
Returns:
the parameters used by this engine

engineMask

protected abstract void engineMask(byte[] mgfSeed,
                                   int mgfSeedOff,
                                   int mgfSeedLen,
                                   int maskLen,
                                   byte[] dst,
                                   int dstOff)
SPI: Uses the mask generation function to generate maskLen bytes from the supplied seed mgfSeed[mgfSeedOff:mgfSeedLen] and XORs the result with dst[off:maskLen].
Parameters:
mgfSeed - the seed from which the mask is generated
mgfSeedOff - the offest indicating the start position within the seed array
mgfSeedLen - the actual number of seed bytes
maskLen - the number of required mask bytes
dst - the destination array to which to XOR the mask result
dstOff - the offset indicating the start position within the destination array

engineReset

protected abstract void engineReset()
SPE: Resets this engine to the state before engineMask has been called.

clone

public Object clone()
             throws CloneNotSupportedException
Returns a clone if the implementation is cloneable.
Overrides:
clone in class Object
Returns:
a clone if the implementation is cloneable.
Throws:
CloneNotSupportedException - if this is called on an implementation that does not support Cloneable.

This Javadoc may contain text parts from Internet Standard specifications (RFC 2459, 3280, 3039, 2560, 1521, 821, 822, 2253, 1319, 1321, ,2630, 2631, 2268, 3058, 2984, 2104, 2144, 2040, 2311, 2279, see copyright note) and RSA Data Security Public-Key Cryptography Standards (PKCS#1,3,5,7,8,9,10,12, see copyright note).

IAIK-JCE 3.1 with IAIK-JCE CC Core 3.1, (c) 1997-2004 IAIK