delete misc

This commit is contained in:
gonzalef 2020-03-31 18:30:06 +02:00
parent 7db155e671
commit a82c8cb60a
2 changed files with 0 additions and 50 deletions

View File

@ -1,27 +0,0 @@
#include "misc.h"
char *hash_data(pub_data *data) {
// Copy data to buf to pass it as string argument
char cpy_data[data->length + 1];
memcpy(cpy_data, data->data, data->length);
cpy_data[data->length] = '\0';
// All three fields are concatenated into a single buf
char *concat_data = concat(3, data->id, data->seqno, data->data);
// The resulting buf is hashed
char *hash = SHA256(concat_data, data->length + 10, 0);
// Free the concatenated buf
free(concat_data);
return hash_trunc(hash);
}
char *hash_network(list *data_list) {
}
char *hash_trunc(char *hash256bit);
char *concat(int argc, ...);

View File

@ -1,23 +0,0 @@
#ifndef MISC_H
#define MISC_H
#include <openssl/sha.h>
#include <stdarg.h>
#include "node.h"
#include "tlv.h"
// General list
typedef struct list {
void *data;
void *next;
} list;
// Hash functions
char *hash_data(pub_data *data);
char *hash_network(list *data_list);
char *hash_trunc(char *hash256bit);
char *concat(int argc, ...);
#endif