Class GrainRefNoopt
java.lang.Object
com.coderslagoon.crypto.estreamj.ciphers.grain.GrainRefNoopt
- All Implemented Interfaces:
ICipher
- Direct Known Subclasses:
Grain128Noopt,GrainP2Noopt
-
Field Summary
Fields inherited from interface com.coderslagoon.crypto.estreamj.framework.ICipher
MODE_DECRYPT, MODE_ENCRYPT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiderase()Erases all sensitive data.intbooleanprotected abstract intvoidprocess(byte[] inBuf, int inOfs, byte[] outBuf, int outOfs, int len) Processes data.voidreset()Resets the instance, so it can be reused.voidsetupKey(int mode, byte[] key, int ofs) Sets up a new key with the existing instance.voidsetupNonce(byte[] nonce, int ofs) Sets up a new nonce with the existing cipher instance.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.coderslagoon.crypto.estreamj.framework.ICipher
getKeySize, getNonceSize
-
Constructor Details
-
GrainRefNoopt
protected GrainRefNoopt()
-
-
Method Details
-
erase
public void erase()Description copied from interface:ICipherErases all sensitive data. Instance MUST be abadonned afterwards. -
getWordSize
public int getWordSize()- Specified by:
getWordSizein interfaceICipher- Returns:
- alignment of data needed during calls into process()
-
isPatented
public boolean isPatented()- Specified by:
isPatentedin interfaceICipher- Returns:
- true: algorithm is patented, check with vendor for license details / false: free to use in private and commercial applications
-
reset
Description copied from interface:ICipherResets the instance, so it can be reused.- Specified by:
resetin interfaceICipher- Throws:
ESJException- if any error occurs
-
process
public void process(byte[] inBuf, int inOfs, byte[] outBuf, int outOfs, int len) throws ESJException Description copied from interface:ICipherProcesses data.- Specified by:
processin interfaceICipher- Parameters:
inBuf- input bufferinOfs- where to start reading from the input bufferoutBuf- output bufferoutOfs- where to start writing in the output bufferlen- number of bytes to process, must be aligned to the cipher's word size except on the last call where an arbitrary size can be used- Throws:
ESJException- in any error occurred
-
setupKey
Description copied from interface:ICipherSets up a new key with the existing instance.- Specified by:
setupKeyin interfaceICipher- Parameters:
mode- see MODE_xxxkey- buffer with key materialofs- where the key starts- Throws:
ESJException- if any error occurs
-
setupNonce
Description copied from interface:ICipherSets up a new nonce with the existing cipher instance.- Specified by:
setupNoncein interfaceICipher- Parameters:
nonce- buffer with nonce materialofs- where the nonce starts- Throws:
ESJException- if any error occurs
-
keyStream
protected abstract int keyStream()
-