resolve darcs stupidity
[org.ibex.core.git] / src / org / bouncycastle / crypto / AsymmetricBlockCipher.java
1 package org.bouncycastle.crypto;
2
3 /**
4  * base interface that a public/private key block cipher needs
5  * to conform to.
6  */
7 public interface AsymmetricBlockCipher
8 {
9     /**
10      * initialise the cipher.
11      *
12      * @param forEncryption if true the cipher is initialised for 
13      *  encryption, if false for decryption.
14      * @param param the key and other data required by the cipher.
15      */
16     public void init(boolean forEncryption, CipherParameters param);
17
18     /**
19      * returns the largest size an input block can be.
20      *
21      * @return maximum size for an input block.
22      */
23     public int getInputBlockSize();
24
25     /**
26      * returns the maximum size of the block produced by this cipher.
27      *
28      * @return maximum size of the output block produced by the cipher.
29      */
30     public int getOutputBlockSize();
31
32     /**
33      * process the block of len bytes stored in in from offset inOff.
34      *
35      * @param in the input data
36      * @param inOff offset into the in array where the data starts
37      * @param len the length of the block to be processed.
38      * @return the resulting byte array of the encryption/decryption process.
39      * @exception InvalidCipherTextException data decrypts improperly.
40      * @exception DataLengthException the input data is too large for the cipher.
41      */
42     public byte[] processBlock(byte[] in, int inOff, int len)
43         throws InvalidCipherTextException;
44 }