MCPcopy Create free account
hub / github.com/F-Stack/f-stack / SipHash_SetKey

Function SipHash_SetKey

freebsd/crypto/siphash/siphash.c:73–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71}
72
73void
74SipHash_SetKey(SIPHASH_CTX *ctx, const uint8_t key[static SIPHASH_KEY_LENGTH])
75{
76 uint64_t k[2];
77
78 KASSERT(ctx->v[0] == 0x736f6d6570736575ull &&
79 ctx->initialized == 1,
80 ("%s: context %p not properly initialized", __func__, ctx));
81
82 k[0] = le64dec(&key[0]);
83 k[1] = le64dec(&key[8]);
84
85 ctx->v[0] ^= k[0];
86 ctx->v[1] ^= k[1];
87 ctx->v[2] ^= k[0];
88 ctx->v[3] ^= k[1];
89
90 ctx->initialized = 2;
91}
92
93static size_t
94SipBuf(SIPHASH_CTX *ctx, const uint8_t **src, size_t len, int final)

Callers 6

SipHashXFunction · 0.85
SipHash24_TestVectorsFunction · 0.85
syncookie_macFunction · 0.85
tcp_keyed_hashFunction · 0.85
tcp_fastopen_make_cookieFunction · 0.85

Calls 1

le64decFunction · 0.85

Tested by 1

SipHash24_TestVectorsFunction · 0.68