Skip to content

Commit

Permalink
Partial update from FFS upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
eisenhauer committed Oct 25, 2023
1 parent 15326e6 commit 6ddbc66
Show file tree
Hide file tree
Showing 5 changed files with 221 additions and 965 deletions.
2 changes: 1 addition & 1 deletion thirdparty/ffs/ffs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ else()
endif()

set(FM_SRC_LIST
fm_formats.c fm_dump.c lookup3.c string_conversion.c fm_get.c xml.c
fm_formats.c fm_dump.c siphash.c string_conversion.c fm_get.c xml.c
${FM_SOCKET_IO})
foreach(FM_SRC ${FM_SRC_LIST})
list(APPEND FM_MASTER_SRC_LIST fm/${FM_SRC})
Expand Down
18 changes: 13 additions & 5 deletions thirdparty/ffs/ffs/fm/fm_formats.c
Original file line number Diff line number Diff line change
Expand Up @@ -1973,12 +1973,20 @@ register_data_format(FMContext context, FMStructDescList struct_list)

INT4 FFS_self_server_IP_addr = 0;

extern void hashlittle2(
const void *key, /* the key to hash */
size_t length, /* length of the key */
INT4 *pc, /* IN: primary initval, OUT: primary hash */
INT4 *pb) /* IN: secondary initval, OUT: secondary hash */;
#include "siphash.h"

static void hashlittle2(
const void *data, /* the data to hash */
size_t length, /* length of the data */
INT4 *pc, /* IN: primary initval, OUT: primary hash */
INT4 *pb)
{
static const uint64_t skey[2] = {0xECB8FF2F434B2FBB, 0xB4E298A99A71F723 };
INT4 output[2];
siphash(data, length, &skey, (uint8_t*) &output[0], sizeof(output));
*pc = output[0];
*pb = output[1];
}

extern void
generate_format3_server_ID(server_ID_type *server_ID,
Expand Down
Loading

0 comments on commit 6ddbc66

Please sign in to comment.