src/hashcontainer.c File Reference

#include <stdlib.h>
#include <string.h>
#include "hashcontainer.h"
#include "rdd.h"

Include dependency graph for hashcontainer.c:

Go to the source code of this file.

Functions

int rdd_get_hash (RDD_HASH_CONTAINER *self, const char *hash_type, uint8_t *hash)
 Retrieves a specific hash from the hashcontainer.
int rdd_hash_present (RDD_HASH_CONTAINER *self, const char *hash_type, int *present)
 Checks if a specific hash is present in the hashcontainer.
int rdd_new_hashcontainer (RDD_HASH_CONTAINER **self)
 Creates an object for storing hashes.
int rdd_set_hash (RDD_HASH_CONTAINER *self, const char *hash_type, const uint8_t *hash)
 Stores a specific hash in the hashcontainer.

Variables

static char copyright []


Function Documentation

int rdd_get_hash ( RDD_HASH_CONTAINER self,
const char *  hash_type,
uint8_t *  hash 
)

Retrieves a specific hash from the hashcontainer.

Parameters:
self a pointer to the hashcontainer.
hash_type a null-terminated string containing the hash name (md5 or sha-1, 256, 384, or 512).
hash output value: space for storing the hash. It is assumed that sufficient space is available in hash (..._DIGEST_LENGTH).
Returns:
Returns RDD_OK on success; returns RDD_NOTFOUND if the hash has not been storedin the hashcontainer.
Note:
.
Routine rdd_get_hash() retrieves a hash from the hashcontainer.

Definition at line 107 of file hashcontainer.c.

References RDD_BADARG, RDD_MD5, RDD_NOTFOUND, RDD_OK, RDD_SHA1, RDD_SHA256, RDD_SHA384, and RDD_SHA512.

int rdd_hash_present ( RDD_HASH_CONTAINER self,
const char *  hash_type,
int *  present 
)

Checks if a specific hash is present in the hashcontainer.

Parameters:
self a pointer to the hashcontainer.
hash_type a null-terminated string containing the hash name (md5 or sha-1, 256, 384, or 512).
hash output value: will be 1 if the hash is present, 0 if it's not.
Returns:
Returns RDD_OK on success.
Note:
.
Routine rdd_hash_present() checks if a specific hash is present in the hash container.

Definition at line 152 of file hashcontainer.c.

References RDD_BADARG, RDD_MD5, RDD_OK, RDD_SHA1, RDD_SHA256, RDD_SHA384, and RDD_SHA512.

int rdd_new_hashcontainer ( RDD_HASH_CONTAINER **  self  ) 

Creates an object for storing hashes.

Parameters:
self output value: the new hashcontainer.
Returns:
Returns RDD_OK on success.
Routine rdd_new_hashes() creates a new hashcontainer object.

Definition at line 49 of file hashcontainer.c.

References error(), RDD_BADARG, RDD_NOMEM, and RDD_OK.

Here is the call graph for this function:

int rdd_set_hash ( RDD_HASH_CONTAINER self,
const char *  hash_type,
const uint8_t *  hash 
)

Stores a specific hash in the hashcontainer.

Parameters:
self a pointer to the hashcontainer.
hash_type a null-terminated string containing the hash name (md5 or sha-1, 256, 384, or 512).
hash the hash itself. It is assumed that sufficient space is available in hash (..._DIGEST_LENGTH).
Returns:
Returns RDD_OK on success.
Routine rdd_set_hash() stores a hash in the hashcontainer.

Definition at line 73 of file hashcontainer.c.

References RDD_BADARG, RDD_MD5, RDD_OK, RDD_SHA1, RDD_SHA256, RDD_SHA384, and RDD_SHA512.


Variable Documentation

char copyright[] [static]

Initial value:

"@(#) Copyright (c) 2002-2004\n\
    Netherlands Forensic Institute.  All rights reserved.\n"

Definition at line 34 of file hashcontainer.c.


Generated on Sun Feb 6 12:36:13 2011 for rdd by  doxygen 1.5.6