Crypto++  5.6.4
Free C++ class library of cryptographic schemes
Static Public Member Functions | List of all members
SafeShifter< true > Class Template Reference

Shifts a value in the presence of overflow. More...

Static Public Member Functions

template<class T >
static T RightShift (T value, unsigned int bits)
 Right shifts a value that overflows. More...
 
template<class T >
static T LeftShift (T value, unsigned int bits)
 Left shifts a value that overflows. More...
 

Detailed Description

template<>
class SafeShifter< true >

Shifts a value in the presence of overflow.

the true template parameter indicates overflow would occur. In this case, SafeShifter clamps the value and returns 0.

Definition at line 2294 of file misc.h.

Member Function Documentation

template<class T >
static T SafeShifter< true >::RightShift ( value,
unsigned int  bits 
)
inlinestatic

Right shifts a value that overflows.

Template Parameters
Tclass or type
Returns
0

Since overflow == true, the value 0 is always returned.

See also
SafeLeftShift

Definition at line 2302 of file misc.h.

template<class T >
static T SafeShifter< true >::LeftShift ( value,
unsigned int  bits 
)
inlinestatic

Left shifts a value that overflows.

Template Parameters
Tclass or type
Returns
0

Since overflow == true, the value 0 is always returned.

See also
SafeRightShift

Definition at line 2314 of file misc.h.


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