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