Security Scol plugin
|
Policy object for additive stream ciphers. More...
#include <strciphr.h>
Public Member Functions | |
virtual unsigned int | GetAlignment () const |
Provides data alignment requirements. | |
virtual unsigned int | GetBytesPerIteration () const =0 |
Provides number of bytes operated upon during an iteration. | |
virtual unsigned int | GetOptimalBlockSize () const |
Provides number of ideal bytes to process. | |
virtual unsigned int | GetIterationsToBuffer () const =0 |
Provides buffer size based on iterations. | |
virtual void | WriteKeystream (byte *keystream, size_t iterationCount) |
Generate the keystream. | |
virtual bool | CanOperateKeystream () const |
Flag indicating. | |
virtual void | OperateKeystream (KeystreamOperation operation, byte *output, const byte *input, size_t iterationCount) |
Operates the keystream. | |
virtual void | CipherSetKey (const NameValuePairs ¶ms, const byte *key, size_t length)=0 |
Key the cipher. | |
virtual void | CipherResynchronize (byte *keystreamBuffer, const byte *iv, size_t length) |
Resynchronize the cipher. | |
virtual bool | CipherIsRandomAccess () const =0 |
Flag indicating random access. | |
virtual void | SeekToIteration (lword iterationCount) |
Seeks to a random position in the stream. | |
virtual std::string | AlgorithmProvider () const |
Retrieve the provider of this algorithm. | |
Policy object for additive stream ciphers.
Definition at line 104 of file strciphr.h.
|
inlinevirtual |
Definition at line 106 of file strciphr.h.
|
inlinevirtual |
Retrieve the provider of this algorithm.
The algorithm provider can be a name like "C++", "SSE", "NEON", "AESNI", "ARMv8" and "Power8". C++ is standard C++ code. Other labels, like SSE, usually indicate a specialized implementation using instructions from a higher instruction set architecture (ISA). Future labels may include external hardware like a hardware security module (HSM).
Generally speaking Wei Dai's original IA-32 ASM code falls under "SSE2". Labels like "SSSE3" and "SSE4.1" follow after Wei's code and use intrinsics instead of ASM.
Algorithms which combine different instructions or ISAs provide the dominant one. For example on x86 AES/GCM
returns "AESNI" rather than "CLMUL" or "AES+SSE4.1" or "AES+CLMUL" or "AES+SSE4.1+CLMUL".
Reimplemented in ChaCha_Policy, ChaChaTLS_Policy, XChaCha20_Policy, PanamaCipherPolicy< B >, Salsa20_Policy, SosemanukPolicy, and AdditiveCipherTemplate< AbstractPolicyHolder< AdditiveCipherAbstractPolicy, CTR_ModePolicy > >.
Definition at line 192 of file strciphr.h.
|
inlinevirtual |
Flag indicating.
Reimplemented in HC128Policy, HC256Policy, CTR_ModePolicy, RabbitPolicy, RabbitWithIVPolicy, AdditiveCipherConcretePolicy< WT, W, X, BASE >, AdditiveCipherConcretePolicy< word32, 1, 64 >, AdditiveCipherConcretePolicy< word32, 16 >, AdditiveCipherConcretePolicy< word32, 20 >, AdditiveCipherConcretePolicy< word32, 256 >, AdditiveCipherConcretePolicy< word32, 4 >, and AdditiveCipherConcretePolicy< word32, 8 >.
Definition at line 139 of file strciphr.h.
|
pure virtual |
Flag indicating random access.
Implemented in ChaCha_Policy, ChaChaTLS_Policy, XChaCha20_Policy, HC128Policy, HC256Policy, OFB_ModePolicy, CTR_ModePolicy, PanamaCipherPolicy< B >, RabbitPolicy, RabbitWithIVPolicy, Salsa20_Policy, SEAL_Policy< B >, SosemanukPolicy, and WAKE_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 ChaCha_Policy, ChaChaTLS_Policy, XChaCha20_Policy, HC128Policy, HC256Policy, OFB_ModePolicy, CTR_ModePolicy, PanamaCipherPolicy< B >, RabbitWithIVPolicy, Salsa20_Policy, XSalsa20_Policy, SEAL_Policy< B >, and SosemanukPolicy.
Definition at line 163 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 ChaCha_Policy, ChaChaTLS_Policy, XChaCha20_Policy, HC128Policy, HC256Policy, PanamaCipherPolicy< B >, RabbitPolicy, RabbitWithIVPolicy, Salsa20_Policy, XSalsa20_Policy, SEAL_Policy< B >, SosemanukPolicy, and WAKE_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 ChaCha_Policy, ChaChaTLS_Policy, XChaCha20_Policy, CTR_ModePolicy, PanamaCipherPolicy< B >, AdditiveCipherConcretePolicy< WT, W, X, BASE >, AdditiveCipherConcretePolicy< word32, 1, 64 >, AdditiveCipherConcretePolicy< word32, 16 >, AdditiveCipherConcretePolicy< word32, 20 >, AdditiveCipherConcretePolicy< word32, 256 >, AdditiveCipherConcretePolicy< word32, 4 >, and AdditiveCipherConcretePolicy< word32, 8 >.
Definition at line 112 of file strciphr.h.
|
pure virtual |
Provides number of bytes operated upon during an iteration.
Implemented in OFB_ModePolicy, CTR_ModePolicy, AdditiveCipherConcretePolicy< WT, W, X, BASE >, AdditiveCipherConcretePolicy< word32, 1, 64 >, AdditiveCipherConcretePolicy< word32, 16 >, AdditiveCipherConcretePolicy< word32, 20 >, AdditiveCipherConcretePolicy< word32, 256 >, AdditiveCipherConcretePolicy< word32, 4 >, and AdditiveCipherConcretePolicy< word32, 8 >.
|
pure virtual |
Provides buffer size based on iterations.
Implemented in OFB_ModePolicy, CTR_ModePolicy, AdditiveCipherConcretePolicy< WT, W, X, BASE >, AdditiveCipherConcretePolicy< word32, 1, 64 >, AdditiveCipherConcretePolicy< word32, 16 >, AdditiveCipherConcretePolicy< word32, 20 >, AdditiveCipherConcretePolicy< word32, 256 >, AdditiveCipherConcretePolicy< word32, 4 >, and AdditiveCipherConcretePolicy< word32, 8 >.
|
inlinevirtual |
Provides number of ideal bytes to process.
Internally, the default implementation returns GetBytesPerIteration()
Reimplemented in ChaCha_Policy, ChaChaTLS_Policy, and XChaCha20_Policy.
Definition at line 123 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 ChaCha_Policy, ChaChaTLS_Policy, XChaCha20_Policy, HC128Policy, HC256Policy, CTR_ModePolicy, PanamaCipherPolicy< B >, RabbitPolicy, RabbitWithIVPolicy, Salsa20_Policy, SEAL_Policy< B >, SosemanukPolicy, WAKE_Policy< B >, AdditiveCipherConcretePolicy< WT, W, X, BASE >, AdditiveCipherConcretePolicy< word32, 1, 64 >, AdditiveCipherConcretePolicy< word32, 16 >, AdditiveCipherConcretePolicy< word32, 20 >, AdditiveCipherConcretePolicy< word32, 256 >, AdditiveCipherConcretePolicy< word32, 4 >, and AdditiveCipherConcretePolicy< word32, 8 >.
Definition at line 149 of file strciphr.h.
|
inlinevirtual |
Seeks to a random position in the stream.
Reimplemented in ChaCha_Policy, ChaChaTLS_Policy, XChaCha20_Policy, CTR_ModePolicy, Salsa20_Policy, and SEAL_Policy< B >.
Definition at line 174 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 133 of file strciphr.h.