File: sanity_test.c

package info (click to toggle)
highwayhash 0~git20200803.9490b14-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 924 kB
  • sloc: cpp: 7,804; ansic: 326; java: 271; makefile: 145; sh: 16
file content (17 lines) | stat: -rw-r--r-- 538 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* Sanity test code for Debian's Highwayhash package [autopkgtest]
 * Author: Adam Borowski
 * Modified: Zhou Mo
 */
#include <assert.h>
#include <highwayhash/c_bindings.h>

static const uint64_t shkey[2]={0xdeadbeef,0xcafebabe};
static const HHKey hhkey={3,14,15,926}; // 4Ă—uint64_t

int main()
{
    assert((uint64_t) 0xaf0a25067c014659 == SipHashC(shkey, "meow", 4));
    assert((uint64_t) 0x600708416bfbe7ad == SipHash13C(shkey, "meow", 4));
	assert((uint64_t) 0x01aeb7e482f04c46 == HighwayHash64(hhkey, "meow", 4));
    return 0;
}