Extended PRF+ by a non-counting variant as used by IKEv1
This commit is contained in:
@@ -27,19 +27,13 @@ typedef struct prf_plus_t prf_plus_t;
|
||||
#include <crypto/prfs/prf.h>
|
||||
|
||||
/**
|
||||
* Implementation of the prf+ function described in IKEv2 RFC.
|
||||
*
|
||||
* This class implements the prf+ algorithm. Internally it uses a pseudo random
|
||||
* function, which implements the prf_t interface.
|
||||
* See IKEv2 RFC 2.13.
|
||||
* Implementation of the prf+ function used in IKEv1/IKEv2 keymat extension.
|
||||
*/
|
||||
struct prf_plus_t {
|
||||
|
||||
/**
|
||||
* Get pseudo random bytes.
|
||||
*
|
||||
* Get the next few bytes of the prf+ output. Space
|
||||
* must be allocated by the caller.
|
||||
*
|
||||
* @param length number of bytes to get
|
||||
* @param buffer pointer where the generated bytes will be written
|
||||
*/
|
||||
@@ -48,9 +42,6 @@ struct prf_plus_t {
|
||||
/**
|
||||
* Allocate pseudo random bytes.
|
||||
*
|
||||
* Get the next few bytes of the prf+ output. This function
|
||||
* will allocate the required space.
|
||||
*
|
||||
* @param length number of bytes to get
|
||||
* @param chunk chunk which will hold generated bytes
|
||||
*/
|
||||
@@ -65,14 +56,11 @@ struct prf_plus_t {
|
||||
/**
|
||||
* Creates a new prf_plus_t object.
|
||||
*
|
||||
* Seed will be cloned. prf will
|
||||
* not be cloned, must be destroyed outside after
|
||||
* prf_plus_t usage.
|
||||
*
|
||||
* @param prf prf object to use
|
||||
* @param prf prf object to use, must be destroyd after prf+.
|
||||
* @param counter use an appending counter byte (for IKEv2 variant)
|
||||
* @param seed input seed for prf
|
||||
* @return prf_plus_t object
|
||||
*/
|
||||
prf_plus_t *prf_plus_create(prf_t *prf, chunk_t seed);
|
||||
prf_plus_t *prf_plus_create(prf_t *prf, bool counter, chunk_t seed);
|
||||
|
||||
#endif /** PRF_PLUS_H_ @}*/
|
||||
|
||||
Reference in New Issue
Block a user