#include <stdlib.h>
#include <string.h>
#include "hashcontainer.h"
#include "rdd.h"
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 [] |
int rdd_get_hash | ( | RDD_HASH_CONTAINER * | self, | |
const char * | hash_type, | |||
uint8_t * | hash | |||
) |
Retrieves a specific hash from the hashcontainer.
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). |
RDD_OK
on success; returns RDD_NOTFOUND
if the hash has not been storedin the hashcontainer. 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.
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. |
RDD_OK
on success. 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.
self | output value: the new hashcontainer. |
RDD_OK
on success.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.
int rdd_set_hash | ( | RDD_HASH_CONTAINER * | self, | |
const char * | hash_type, | |||
const uint8_t * | hash | |||
) |
Stores a specific hash in the hashcontainer.
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). |
RDD_OK
on success.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.
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.