Skip to content

Commit

Permalink
Changed function to accept const key
Browse files Browse the repository at this point in the history
  • Loading branch information
paulharris committed Apr 29, 2013
1 parent 6953462 commit 668b1c1
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion siphash.c
Expand Up @@ -15,7 +15,7 @@ U64TO8_LE(unsigned char *p, const uint64_t v) {
*/

uint64_t
siphash(unsigned char key[16], const unsigned char *m, size_t len) {
siphash(const unsigned char key[16], const unsigned char *m, size_t len) {
uint64_t v0, v1, v2, v3;
uint64_t mi, k0, k1;
uint64_t last7;
Expand Down
2 changes: 1 addition & 1 deletion siphash.h
Expand Up @@ -12,7 +12,7 @@
extern "C" {
#endif

uint64_t siphash(unsigned char key[16], const unsigned char *m, size_t len);
uint64_t siphash(const unsigned char key[16], const unsigned char *m, size_t len);

#ifdef __cplusplus /* If this is a C++ compiler, end C linkage */
}
Expand Down
4 changes: 2 additions & 2 deletions siphash_sse2.c
Expand Up @@ -11,7 +11,7 @@ static const packedelem64 siphash_final = {
};

uint64_t
siphash(unsigned char key[16], const unsigned char *m, size_t len) {
siphash(const unsigned char key[16], const unsigned char *m, size_t len) {
xmmi k,v02,v20,v13,v11,v33,mi;
uint64_t last7;
uint32_t lo, hi;
Expand Down Expand Up @@ -80,4 +80,4 @@ siphash(unsigned char key[16], const unsigned char *m, size_t len) {
lo = _mm_cvtsi128_si32(v02);
hi = _mm_cvtsi128_si32(_mm_srli_si128(v02, 4));
return ((uint64_t)hi << 32) | lo;
}
}
2 changes: 1 addition & 1 deletion siphash_ssse3.c
Expand Up @@ -15,7 +15,7 @@ static const packedelem8 siphash_rot16v3 = {
};

uint64_t
siphash(unsigned char key[16], const unsigned char *m, size_t len) {
siphash(const unsigned char key[16], const unsigned char *m, size_t len) {
xmmi k,v02,v20,v13,v11,v33,mi;
uint64_t last7;
uint32_t lo, hi;
Expand Down

0 comments on commit 668b1c1

Please sign in to comment.