Fabcoin Core
0.16.2
P2P Digital Currency
|
Policy object for additive stream ciphers. More...
#include <strciphr.h>
Public Member Functions | |
virtual | ~AdditiveCipherAbstractPolicy () |
virtual unsigned int | GetAlignment () const |
Provides data alignment requirements. More... | |
virtual unsigned int | GetBytesPerIteration () const =0 |
Provides number of bytes operated upon during an iteration. More... | |
virtual unsigned int | GetOptimalBlockSize () const |
Provides number of ideal bytes to process. More... | |
virtual unsigned int | GetIterationsToBuffer () const =0 |
Provides buffer size based on iterations. More... | |
virtual void | WriteKeystream (byte *keystream, size_t iterationCount) |
Generate the keystream. More... | |
virtual bool | CanOperateKeystream () const |
Flag indicating. More... | |
virtual void | OperateKeystream (KeystreamOperation operation, byte *output, const byte *input, size_t iterationCount) |
Operates the keystream. More... | |
virtual void | CipherSetKey (const NameValuePairs ¶ms, const byte *key, size_t length)=0 |
Key the cipher. More... | |
virtual void | CipherResynchronize (byte *keystreamBuffer, const byte *iv, size_t length) |
Resynchronize the cipher. More... | |
virtual bool | CipherIsRandomAccess () const =0 |
Flag indicating random access. More... | |
virtual void | SeekToIteration (lword iterationCount) |
Seeks to a random position in the stream. More... | |
Policy object for additive stream ciphers.
Definition at line 106 of file strciphr.h.
|
inlinevirtual |
Definition at line 108 of file strciphr.h.
|
inlinevirtual |
Flag indicating.
Reimplemented in AdditiveCipherConcretePolicy< word32, 20 >, AdditiveCipherConcretePolicy< word32, 8 >, AdditiveCipherConcretePolicy< word32, 256 >, AdditiveCipherConcretePolicy< word32, 16 >, AdditiveCipherConcretePolicy< word32, 1, 64 >, and CTR_ModePolicy.
Definition at line 141 of file strciphr.h.
|
pure virtual |
Flag indicating random access.
Implemented in CTR_ModePolicy, OFB_ModePolicy, PanamaCipherPolicy< B >, WAKE_Policy< B >, ChaCha_Policy< R >, SosemanukPolicy, Salsa20_Policy, and SEAL_Policy< B >.
|
inlinevirtual |
Resynchronize the cipher.
keystreamBuffer | the keystream buffer |
iv | a byte array used to resynchronize the cipher |
length | the size of the IV array |
Reimplemented in CTR_ModePolicy, OFB_ModePolicy, PanamaCipherPolicy< B >, XSalsa20_Policy, ChaCha_Policy< R >, SosemanukPolicy, Salsa20_Policy, and SEAL_Policy< B >.
Definition at line 164 of file strciphr.h.
|
pure virtual |
Key the cipher.
params | set of NameValuePairs use to initialize this object |
key | a byte array used to key the cipher |
length | the size of the key array |
Implemented in PanamaCipherPolicy< B >, ModePolicyCommonTemplate< AdditiveCipherAbstractPolicy >, XSalsa20_Policy, WAKE_Policy< B >, ChaCha_Policy< R >, SosemanukPolicy, Salsa20_Policy, and SEAL_Policy< B >.
|
inlinevirtual |
Provides data alignment requirements.
Internally, the default implementation returns 1. If the stream cipher is implemented using an SSE2 ASM or intrinsics, then the value returned is usually 16.
Reimplemented in AdditiveCipherConcretePolicy< word32, 20 >, AdditiveCipherConcretePolicy< word32, 8 >, AdditiveCipherConcretePolicy< word32, 256 >, AdditiveCipherConcretePolicy< word32, 16 >, AdditiveCipherConcretePolicy< word32, 1, 64 >, CTR_ModePolicy, PanamaCipherPolicy< B >, ModePolicyCommonTemplate< AdditiveCipherAbstractPolicy >, and ChaCha_Policy< R >.
Definition at line 114 of file strciphr.h.
|
pure virtual |
Provides number of bytes operated upon during an iteration.
Implemented in AdditiveCipherConcretePolicy< word32, 20 >, AdditiveCipherConcretePolicy< word32, 8 >, AdditiveCipherConcretePolicy< word32, 256 >, AdditiveCipherConcretePolicy< word32, 16 >, AdditiveCipherConcretePolicy< word32, 1, 64 >, CTR_ModePolicy, and OFB_ModePolicy.
|
pure virtual |
Provides buffer size based on iterations.
Implemented in AdditiveCipherConcretePolicy< word32, 20 >, AdditiveCipherConcretePolicy< word32, 8 >, AdditiveCipherConcretePolicy< word32, 256 >, AdditiveCipherConcretePolicy< word32, 16 >, AdditiveCipherConcretePolicy< word32, 1, 64 >, CTR_ModePolicy, and OFB_ModePolicy.
|
inlinevirtual |
Provides number of ideal bytes to process.
Internally, the default implementation returns GetBytesPerIteration()
Reimplemented in ChaCha_Policy< R >.
Definition at line 125 of file strciphr.h.
|
inlinevirtual |
Operates the keystream.
operation | the operation with additional flags |
output | the output buffer |
input | the input buffer |
iterationCount | the number of iterations to perform on the input |
OperateKeystream() will attempt to operate upon GetOptimalBlockSize() buffer, which will be derived from GetBytesPerIteration().
Reimplemented in AdditiveCipherConcretePolicy< word32, 20 >, AdditiveCipherConcretePolicy< word32, 8 >, AdditiveCipherConcretePolicy< word32, 256 >, AdditiveCipherConcretePolicy< word32, 16 >, AdditiveCipherConcretePolicy< word32, 1, 64 >, CTR_ModePolicy, PanamaCipherPolicy< B >, WAKE_Policy< B >, ChaCha_Policy< R >, SosemanukPolicy, Salsa20_Policy, and SEAL_Policy< B >.
Definition at line 151 of file strciphr.h.
|
inlinevirtual |
Seeks to a random position in the stream.
Reimplemented in CTR_ModePolicy, ChaCha_Policy< R >, Salsa20_Policy, and SEAL_Policy< B >.
Definition at line 175 of file strciphr.h.
|
inlinevirtual |
Generate the keystream.
keystream | the key stream |
iterationCount | the number of iterations to generate the key stream |
Reimplemented in CTR_ModePolicy, and OFB_ModePolicy.
Definition at line 135 of file strciphr.h.