- typedefs changed
This commit is contained in:
@@ -26,12 +26,12 @@
|
||||
#include <encoding/payloads/transform_substructure.h>
|
||||
|
||||
|
||||
typedef struct crypter_t crypter_t;
|
||||
|
||||
/**
|
||||
* Object representing a crypter object
|
||||
*/
|
||||
typedef struct crypter_s crypter_t;
|
||||
|
||||
struct crypter_s {
|
||||
struct crypter_t {
|
||||
/**
|
||||
* @brief Encrypt a chunk of data and allocate space for
|
||||
* the encrypted value.
|
||||
|
||||
@@ -289,12 +289,12 @@ static u_int8_t group18_modulus[] = {
|
||||
0x60,0xC9,0x80,0xDD,0x98,0xED,0xD3,0xDF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
|
||||
};
|
||||
|
||||
typedef struct modulus_info_entry_t modulus_info_entry_t;
|
||||
|
||||
/**
|
||||
* Entry of the modulus list
|
||||
*/
|
||||
typedef struct modulus_info_entry_s modulus_info_entry_t;
|
||||
|
||||
struct modulus_info_entry_s{
|
||||
struct modulus_info_entry_t {
|
||||
/**
|
||||
* Group number as it is defined in transform_substructure.h
|
||||
*/
|
||||
@@ -328,13 +328,13 @@ static modulus_info_entry_t modulus_info_entries[] = {
|
||||
{MODP_8192_BIT,group18_modulus,sizeof(group18_modulus),2},
|
||||
};
|
||||
|
||||
typedef struct private_diffie_hellman_t private_diffie_hellman_t;
|
||||
|
||||
/**
|
||||
* Private data of an diffie_hellman_t object.
|
||||
*
|
||||
*/
|
||||
typedef struct private_diffie_hellman_s private_diffie_hellman_t;
|
||||
|
||||
struct private_diffie_hellman_s {
|
||||
struct private_diffie_hellman_t {
|
||||
/**
|
||||
* public diffie_hellman_t interface
|
||||
*/
|
||||
|
||||
@@ -26,13 +26,13 @@
|
||||
#include <types.h>
|
||||
#include <encoding/payloads/transform_substructure.h>
|
||||
|
||||
typedef struct diffie_hellman_t diffie_hellman_t;
|
||||
|
||||
/**
|
||||
* Object representing a diffie hellman exchange
|
||||
*
|
||||
*/
|
||||
typedef struct diffie_hellman_s diffie_hellman_t;
|
||||
|
||||
struct diffie_hellman_s {
|
||||
struct diffie_hellman_t {
|
||||
|
||||
/**
|
||||
* @brief Returns the shared secret of this diffie hellman exchange
|
||||
|
||||
@@ -26,23 +26,23 @@
|
||||
|
||||
#include <types.h>
|
||||
|
||||
typedef enum hash_algorithm_t hash_algorithm_t;
|
||||
|
||||
/**
|
||||
* algorithms to use for hashing
|
||||
*/
|
||||
typedef enum hash_algorithm_e hash_algorithm_t;
|
||||
|
||||
enum hash_algorithm_e {
|
||||
enum hash_algorithm_t {
|
||||
HASH_SHA1,
|
||||
HASH_MD5
|
||||
};
|
||||
|
||||
|
||||
typedef struct hasher_t hasher_t;
|
||||
|
||||
/**
|
||||
* Object representing a hasher
|
||||
*/
|
||||
typedef struct hasher_s hasher_t;
|
||||
|
||||
struct hasher_s {
|
||||
struct hasher_t {
|
||||
/**
|
||||
* @brief hash data and write it in the buffer
|
||||
*
|
||||
|
||||
@@ -98,12 +98,12 @@ Rotation is separate from addition to prevent recomputation.
|
||||
|
||||
|
||||
|
||||
typedef struct private_hasher_md5_t private_hasher_md5_t;
|
||||
|
||||
/**
|
||||
* private data structure with hasing context
|
||||
*/
|
||||
typedef struct private_hasher_md5_s private_hasher_md5_t;
|
||||
|
||||
struct private_hasher_md5_s {
|
||||
struct private_hasher_md5_t {
|
||||
/**
|
||||
* public interface for this hasher
|
||||
*/
|
||||
|
||||
@@ -27,13 +27,13 @@
|
||||
#include <transforms/hashers/hasher.h>
|
||||
|
||||
|
||||
typedef struct hasher_md5_t hasher_md5_t;
|
||||
|
||||
/**
|
||||
* Object representing the md5 hasher
|
||||
*
|
||||
*/
|
||||
typedef struct hasher_md5_s hasher_md5_t;
|
||||
|
||||
struct hasher_md5_s {
|
||||
struct hasher_md5_t {
|
||||
|
||||
/**
|
||||
* generic hasher_t interface for this hasher
|
||||
|
||||
@@ -53,12 +53,12 @@
|
||||
#define R4(v,w,x,y,z,i) z+=(w^x^y)+blk(i)+0xCA62C1D6+rol(v,5);w=rol(w,30);
|
||||
|
||||
|
||||
typedef struct private_hasher_sha1_t private_hasher_sha1_t;
|
||||
|
||||
/**
|
||||
* private data structure with hasing context
|
||||
*/
|
||||
typedef struct private_hasher_sha1_s private_hasher_sha1_t;
|
||||
|
||||
struct private_hasher_sha1_s {
|
||||
struct private_hasher_sha1_t {
|
||||
/**
|
||||
* public interface for this hasher
|
||||
*/
|
||||
|
||||
@@ -27,13 +27,13 @@
|
||||
#include <transforms/hashers/hasher.h>
|
||||
|
||||
|
||||
typedef struct hasher_sha1_t hasher_sha1_t;
|
||||
|
||||
/**
|
||||
* Object representing the sha1 hasher
|
||||
*
|
||||
*/
|
||||
typedef struct hasher_sha1_s hasher_sha1_t;
|
||||
|
||||
struct hasher_sha1_s {
|
||||
struct hasher_sha1_t {
|
||||
|
||||
/**
|
||||
* generic hasher_t interface for this hasher
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
/**
|
||||
* @file hmac.c
|
||||
*
|
||||
* @brief Implementation of message authentication
|
||||
* using cryptographic hash functions (HMAC). See RFC2104.
|
||||
*
|
||||
* @brief Implementation of hmac_t
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -26,13 +24,13 @@
|
||||
|
||||
#include <utils/allocator.h>
|
||||
|
||||
typedef struct private_hmac_t private_hmac_t;
|
||||
|
||||
/**
|
||||
* Private data of an hmac_t object.
|
||||
*
|
||||
*/
|
||||
typedef struct private_hmac_s private_hmac_t;
|
||||
|
||||
struct private_hmac_s {
|
||||
struct private_hmac_t {
|
||||
/**
|
||||
* public hmac_t interface
|
||||
*/
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
/**
|
||||
* @file hmac.h
|
||||
*
|
||||
* @brief Implementation of message authentication
|
||||
* using cryptographic hash functions (HMAC). See RFC2104.
|
||||
*
|
||||
* @brief Interface of hmac_t.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -24,16 +22,25 @@
|
||||
#ifndef HMAC_H_
|
||||
#define HMAC_H_
|
||||
|
||||
|
||||
#include <transforms/hashers/hasher.h>
|
||||
#include <definitions.h>
|
||||
|
||||
|
||||
typedef struct hmac_t hmac_t;
|
||||
|
||||
|
||||
/**
|
||||
* Object representing a hmac
|
||||
* @brief Message authentication based using hash functions.
|
||||
*
|
||||
* This class implements the message authenticaion algorithm
|
||||
* described in RFC2104. It uses a hash function, wich must
|
||||
* be implemented as a hasher_t class.
|
||||
*
|
||||
* @see hasher_t, prf_hmac_t
|
||||
*
|
||||
* @ingroup transforms
|
||||
*/
|
||||
typedef struct hmac_s hmac_t;
|
||||
|
||||
struct hmac_s {
|
||||
struct hmac_t {
|
||||
/**
|
||||
* @brief Generate message authentication code.
|
||||
*
|
||||
@@ -98,13 +105,19 @@ struct hmac_s {
|
||||
};
|
||||
|
||||
/**
|
||||
* Creates a new hmac_t object
|
||||
* @brief Creates a new hmac_t object.
|
||||
*
|
||||
* Creates a new hmac_t object using sing hash_algorithm to
|
||||
* create a hasher_t internally.
|
||||
*
|
||||
* @param hash_algorithm hash algorithm to use
|
||||
* @return
|
||||
* - hmac_t if successfully
|
||||
* - NULL if out of ressources or hash not supported
|
||||
*
|
||||
* @ingroup transforms
|
||||
*/
|
||||
hmac_t *hmac_create(hash_algorithm_t hash_algorithm);
|
||||
|
||||
|
||||
#endif /*HMAC_H_*/
|
||||
|
||||
@@ -26,13 +26,13 @@
|
||||
#include <utils/allocator.h>
|
||||
#include <definitions.h>
|
||||
|
||||
typedef struct private_prf_plus_t private_prf_plus_t;
|
||||
|
||||
/**
|
||||
* Private data of an prf_plus_t object.
|
||||
*
|
||||
*/
|
||||
typedef struct private_prf_plus_s private_prf_plus_t;
|
||||
|
||||
struct private_prf_plus_s {
|
||||
struct private_prf_plus_t {
|
||||
/**
|
||||
* public prf_plus_t interface
|
||||
*/
|
||||
|
||||
@@ -27,12 +27,12 @@
|
||||
#include <transforms/prfs/prf.h>
|
||||
|
||||
|
||||
typedef struct prf_plus_t prf_plus_t;
|
||||
|
||||
/**
|
||||
* Object representing a prf_plus
|
||||
*/
|
||||
typedef struct prf_plus_s prf_plus_t;
|
||||
|
||||
struct prf_plus_s {
|
||||
struct prf_plus_t {
|
||||
/**
|
||||
* @brief Get pseudo random bytes.
|
||||
*
|
||||
|
||||
@@ -26,12 +26,14 @@
|
||||
#include <encoding/payloads/transform_substructure.h>
|
||||
|
||||
|
||||
typedef struct prf_t prf_t;
|
||||
|
||||
/**
|
||||
* Object representing a diffie hellman exchange
|
||||
*
|
||||
* @ingroup prfs
|
||||
*/
|
||||
typedef struct prf_s prf_t;
|
||||
|
||||
struct prf_s {
|
||||
struct prf_t {
|
||||
/**
|
||||
* @brief generates pseudo random bytes and writes them
|
||||
* in the buffer
|
||||
@@ -89,6 +91,8 @@ struct prf_s {
|
||||
* @return
|
||||
* - prf_t if successfully
|
||||
* - NULL if out of ressources or prf not supported
|
||||
*
|
||||
* @ingroup prfs
|
||||
*/
|
||||
prf_t *prf_create(pseudo_random_function_t pseudo_random_function);
|
||||
|
||||
|
||||
@@ -26,9 +26,9 @@
|
||||
#include <utils/allocator.h>
|
||||
#include <transforms/hmac.h>
|
||||
|
||||
typedef struct private_prf_hmac_s private_prf_hmac_t;
|
||||
typedef struct private_prf_hmac_t private_prf_hmac_t;
|
||||
|
||||
struct private_prf_hmac_s {
|
||||
struct private_prf_hmac_t {
|
||||
/**
|
||||
* public interface for this prf
|
||||
*/
|
||||
|
||||
@@ -29,13 +29,13 @@
|
||||
#include <types.h>
|
||||
#include <transforms/hashers/hasher.h>
|
||||
|
||||
typedef struct prf_hmac_t prf_hmac_t;
|
||||
|
||||
/**
|
||||
* Object representing a prf using HMAC
|
||||
*
|
||||
*/
|
||||
typedef struct prf_hmac_s prf_hmac_t;
|
||||
|
||||
struct prf_hmac_s {
|
||||
struct prf_hmac_t {
|
||||
|
||||
/**
|
||||
* generic prf_t interface for this prf
|
||||
|
||||
@@ -26,12 +26,12 @@
|
||||
#include <encoding/payloads/transform_substructure.h>
|
||||
|
||||
|
||||
typedef struct signer_t signer_t;
|
||||
|
||||
/**
|
||||
* Object representing a diffie hellman exchange
|
||||
*/
|
||||
typedef struct signer_s signer_t;
|
||||
|
||||
struct signer_s {
|
||||
struct signer_t {
|
||||
/**
|
||||
* @brief generates pseudo random bytes and writes them
|
||||
* in the buffer
|
||||
|
||||
Reference in New Issue
Block a user