00001
00002
00003
00004
00005
00006 #ifndef _CHIMERA_KEY_H_
00007 #define _CHIMERA_KEY_H_
00008
00009 #include <limits.h>
00010 #include <stdio.h>
00011 #include <openssl/evp.h>
00012 #include <string.h>
00013
00014 typedef struct {
00015 unsigned long t[5];
00016 char keystr[64];
00017 } Key;
00018
00019 #define KEY_SIZE 160
00020 #define BASE_B 4
00021
00022
00023 Key Key_Max;
00024 Key Key_Half;
00025
00026
00027
00028 void key_makehash(void * logs, Key *hashed, char *s);
00029
00030
00031
00032
00033
00034 void key_init();
00035
00036
00037
00038
00039 void key_distance(void * logs, Key *diff, Key k1, Key k2);
00040
00041
00042
00043
00044
00045
00046 int key_between(void * logs, Key test, Key left, Key right);
00047
00048
00049
00050
00051
00052 void key_midpoint(void * logs, Key *mid, Key key);
00053
00054
00055
00056
00057
00058 int key_index(void * logs, Key mykey, Key k);
00059
00060 void key_print(Key k);
00061
00062 void key_to_str(char *str, Key k);
00063 void str_to_key(char *str, Key *k);
00064
00065
00066
00067
00068 void key_assign(Key *k1, Key k2);
00069
00070
00071
00072
00073 void key_assign_ui(Key *k,unsigned long ul);
00074
00075
00076
00077
00078 int key_equal(Key k1,Key k2);
00079
00080
00081
00082
00083 int key_equal_ui(Key k, unsigned long ul);
00084
00085
00086
00087
00088 int key_comp(Key k1, Key k2);
00089
00090 #endif