Security Scol plugin
Public Member Functions | List of all members
CFB_CipherAbstractPolicy Class Referenceabstract

Policy object for feedback based stream ciphers. More...

#include <strciphr.h>

Inheritance diagram for CFB_CipherAbstractPolicy:
ModePolicyCommonTemplate< CFB_CipherAbstractPolicy > CFB_CipherConcretePolicy< WT, W, BASE > CFB_ModePolicy

Public Member Functions

virtual unsigned int GetAlignment () const =0
 Provides data alignment requirements.
 
virtual unsigned int GetBytesPerIteration () const =0
 Provides number of bytes operated upon during an iteration.
 
virtual byteGetRegisterBegin ()=0
 Access the feedback register.
 
virtual void TransformRegister ()=0
 TODO.
 
virtual bool CanIterate () const
 Flag indicating iteration support.
 
virtual void Iterate (byte *output, const byte *input, CipherDir dir, size_t iterationCount)
 Iterate the cipher.
 
virtual void CipherSetKey (const NameValuePairs &params, const byte *key, size_t length)=0
 Key the cipher.
 
virtual void CipherResynchronize (const byte *iv, size_t length)
 Resynchronize the cipher.
 
virtual std::string AlgorithmProvider () const
 Retrieve the provider of this algorithm.
 

Detailed Description

Policy object for feedback based stream ciphers.

Definition at line 402 of file strciphr.h.

Constructor & Destructor Documentation

◆ ~CFB_CipherAbstractPolicy()

virtual CFB_CipherAbstractPolicy::~CFB_CipherAbstractPolicy ( )
inlinevirtual

Definition at line 405 of file strciphr.h.

Member Function Documentation

◆ AlgorithmProvider()

virtual std::string CFB_CipherAbstractPolicy::AlgorithmProvider ( ) const
inlinevirtual

Retrieve the provider of this algorithm.

Returns
the algorithm provider

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".

Note
Provider is not universally implemented yet.

Definition at line 467 of file strciphr.h.

◆ CanIterate()

virtual bool CFB_CipherAbstractPolicy::CanIterate ( ) const
inlinevirtual

Flag indicating iteration support.

Returns
true if the cipher supports iteration, false otherwise

Reimplemented in CFB_ModePolicy, and CFB_CipherConcretePolicy< WT, W, BASE >.

Definition at line 427 of file strciphr.h.

◆ CipherResynchronize()

virtual void CFB_CipherAbstractPolicy::CipherResynchronize ( const byte iv,
size_t  length 
)
inlinevirtual

Resynchronize the cipher.

Parameters
iva byte array used to resynchronize the cipher
lengththe size of the IV array

Reimplemented in CFB_ModePolicy.

Definition at line 449 of file strciphr.h.

◆ CipherSetKey()

virtual void CFB_CipherAbstractPolicy::CipherSetKey ( const NameValuePairs params,
const byte key,
size_t  length 
)
pure virtual

Key the cipher.

Parameters
paramsset of NameValuePairs use to initialize this object
keya byte array used to key the cipher
lengththe size of the key array

◆ GetAlignment()

virtual unsigned int CFB_CipherAbstractPolicy::GetAlignment ( ) const
pure virtual

Provides data alignment requirements.

Returns
data alignment requirements, in bytes

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.

Implemented in CFB_CipherConcretePolicy< WT, W, BASE >.

◆ GetBytesPerIteration()

virtual unsigned int CFB_CipherAbstractPolicy::GetBytesPerIteration ( ) const
pure virtual

Provides number of bytes operated upon during an iteration.

Returns
bytes operated upon during an iteration, in bytes
See also
GetOptimalBlockSize()

Implemented in CFB_ModePolicy, and CFB_CipherConcretePolicy< WT, W, BASE >.

◆ GetRegisterBegin()

virtual byte * CFB_CipherAbstractPolicy::GetRegisterBegin ( )
pure virtual

Access the feedback register.

Returns
pointer to the first byte of the feedback register

Implemented in CFB_ModePolicy.

◆ Iterate()

virtual void CFB_CipherAbstractPolicy::Iterate ( byte output,
const byte input,
CipherDir  dir,
size_t  iterationCount 
)
inlinevirtual

Iterate the cipher.

Parameters
outputthe output buffer
inputthe input buffer
dirthe direction of the cipher
iterationCountthe number of iterations to perform on the input
See also
IsSelfInverting() and IsForwardTransformation()

Reimplemented in CFB_ModePolicy.

Definition at line 435 of file strciphr.h.

◆ TransformRegister()

virtual void CFB_CipherAbstractPolicy::TransformRegister ( )
pure virtual

The documentation for this class was generated from the following file: