|
|
|
@ -27,39 +27,6 @@ int sort_by_hash (const void *v1, const void *v2, void *v3);
|
|
|
|
|
int sort_by_hash_no_salt (const void *v1, const void *v2, void *v3);
|
|
|
|
|
// get rid of this later
|
|
|
|
|
|
|
|
|
|
int sort_by_pot (const void *v1, const void *v2, MAYBE_UNUSED void *v3)
|
|
|
|
|
{
|
|
|
|
|
const pot_t *p1 = (const pot_t *) v1;
|
|
|
|
|
const pot_t *p2 = (const pot_t *) v2;
|
|
|
|
|
|
|
|
|
|
const hash_t *h1 = &p1->hash;
|
|
|
|
|
const hash_t *h2 = &p2->hash;
|
|
|
|
|
|
|
|
|
|
return sort_by_hash (h1, h2, v3);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int sort_by_salt_buf (const void *v1, const void *v2, MAYBE_UNUSED void *v3)
|
|
|
|
|
{
|
|
|
|
|
const pot_t *p1 = (const pot_t *) v1;
|
|
|
|
|
const pot_t *p2 = (const pot_t *) v2;
|
|
|
|
|
|
|
|
|
|
const hash_t *h1 = &p1->hash;
|
|
|
|
|
const hash_t *h2 = &p2->hash;
|
|
|
|
|
|
|
|
|
|
const salt_t *s1 = h1->salt;
|
|
|
|
|
const salt_t *s2 = h2->salt;
|
|
|
|
|
|
|
|
|
|
u32 n = 16;
|
|
|
|
|
|
|
|
|
|
while (n--)
|
|
|
|
|
{
|
|
|
|
|
if (s1->salt_buf[n] > s2->salt_buf[n]) return 1;
|
|
|
|
|
if (s1->salt_buf[n] < s2->salt_buf[n]) return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int sort_by_hash_t_salt (const void *v1, const void *v2)
|
|
|
|
|
{
|
|
|
|
|
const hash_t *h1 = (const hash_t *) v1;
|
|
|
|
|