Crypto++ 8.0 Free C++ class library of cryptographic schemes

Public Types | Public Member Functions | List of all members
DL_PublicKey< T > Class Template Referenceabstract

Interface for Discrete Log (DL) public keys. More...

Inheritance diagram for DL_PublicKey< T >:

## Public Types
typedef T | Element

## Public Member Functions
bool | GetVoidValue (const char *name, const std::type_info &valueType, void *pValue) const
| Get a named value. More...
void | AssignFrom (const NameValuePairs &source)
| Initialize or reinitialize this key. More...
virtual const Element & | GetPublicElement () const
| Retrieves the public element. More...
virtual void | SetPublicElement (const Element &y)
| Sets the public element. More...
virtual Element | ExponentiatePublicElement (const Integer &exponent) const
| Exponentiates this element. More...
virtual Element | CascadeExponentiateBaseAndPublicElement (const Integer &baseExp, const Integer &publicExp) const
| Exponentiates an element. More...
virtual const DL_FixedBasePrecomputation< T > & | GetPublicPrecomputation () const =0
| Accesses the public precomputation. More...
virtual DL_FixedBasePrecomputation< T > & | AccessPublicPrecomputation ()=0
| Accesses the public precomputation. More...
Public Member Functions inherited from DL_Key< T >
virtual const DL_GroupParameters< T > & | GetAbstractGroupParameters () const =0
| Retrieves abstract group parameters. More...
virtual DL_GroupParameters< T > & | AccessAbstractGroupParameters ()=0
| Retrieves abstract group parameters. More...

## Detailed Description

### template<class T>
class DL_PublicKey< T >

Interface for Discrete Log (DL) public keys.

Definition at line 1028 of file pubkey.h.

## Member Function Documentation

## ◆ GetVoidValue()

template<class T>

bool DL_PublicKey< T >::GetVoidValue | ( | const char * | name,
|  | const std::type_info & | valueType,
|  | void * | pValue
| ) |  | const
| inline

Get a named value.

Parameters

  name | the name of the object or value to retrieve
  valueType | reference to a variable that receives the value
  pValue | void pointer to a variable that receives the value

Returns
  true if the value was retrieved, false otherwise

GetVoidValue() retrieves the value of name if it exists.

Note
  GetVoidValue() is an internal function and should be implemented by derived classes. Users should use one of the other functions instead.

See also
  GetValue(), GetValueWithDefault(), GetIntValue(), GetIntValueWithDefault(), GetRequiredParameter() and GetRequiredIntParameter()

Definition at line 1047 of file pubkey.h.

## ◆ AssignFrom()

template<class T >

void DL_PublicKey< T >::AssignFrom | ( | const NameValuePairs & | source | ) |

Initialize or reinitialize this key.

Parameters

  source | NameValuePairs to assign

Definition at line 1162 of file pubkey.h.

## ◆ GetPublicElement()

template<class T>

virtual const Element& DL_PublicKey< T >::GetPublicElement | ( |  | ) | const
| inline virtual

Retrieves the public element.

Returns
  the public element

Definition at line 1059 of file pubkey.h.

## ◆ SetPublicElement()

template<class T>

virtual void DL_PublicKey< T >::SetPublicElement | ( | const Element & | y | ) |
| inline virtual

Sets the public element.

Parameters

  y | the public element

Definition at line 1063 of file pubkey.h.

## ◆ ExponentiatePublicElement()

template<class T>

virtual Element DL_PublicKey< T >::ExponentiatePublicElement | ( | const Integer & | exponent | ) | const
| inline virtual

Exponentiates this element.

Parameters

  exponent | the exponent to raise the base

Returns
  the public element raised to the exponent

Definition at line 1068 of file pubkey.h.

## ◆ CascadeExponentiateBaseAndPublicElement()

template<class T>

virtual Element DL_PublicKey< T >::CascadeExponentiateBaseAndPublicElement | ( | const Integer & | baseExp,
|  | const Integer & | publicExp
| ) |  | const
| inline virtual

Exponentiates an element.

Parameters

  baseExp | the first exponent
  publicExp | the second exponent

Returns
  the public element raised to the exponent

CascadeExponentiateBaseAndPublicElement raises the public element to the base element and precomputation.

Definition at line 1080 of file pubkey.h.

## ◆ GetPublicPrecomputation()

template<class T>

virtual const DL_FixedBasePrecomputation<T>& DL_PublicKey< T >::GetPublicPrecomputation | ( |  | ) | const
| pure virtual

Accesses the public precomputation.

GetPublicPrecomputation returns a const reference, while AccessPublicPrecomputation returns a non-const reference. Must be overridden in derived classes.

Implemented in DL_PublicKeyImpl< GP >, and DL_PublicKeyImpl< DL_GroupParameters_EC< EC > >.

## ◆ AccessPublicPrecomputation()

template<class T>

virtual DL_FixedBasePrecomputation<T>& DL_PublicKey< T >::AccessPublicPrecomputation | ( |  | ) |
| pure virtual

Accesses the public precomputation.

GetPublicPrecomputation returns a const reference, while AccessPublicPrecomputation returns a non-const reference. Must be overridden in derived classes.

Implemented in DL_PublicKeyImpl< GP >, and DL_PublicKeyImpl< DL_GroupParameters_EC< EC > >.

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

- pubkey.h