Commits

evhan  committed 8caf104

add basic tests for make-siphash, short keys & string arguments

  • Participants
  • Parent commits 6125ed7

Comments (0)

Files changed (1)

File tests/run.scm

      "6ca4ecb15c5f91e1" "9f626da15c9625f3" "e51b38608ef25f57" "958a324ceb064572"))
 
 (test-begin "siphash")
+(test-assert "(make-siphash c d)" (procedure? (make-siphash 1 2)))
+(test-assert "(siphash-c-d key)" (procedure? ((make-siphash 1 2) key)))
+(test-assert "(siphash-c-d key message)" (integer? ((make-siphash 1 2) key key)))
+(test-error "(siphash-2-4 short-key)" (siphash-2-4 (u8vector 0 1 2 3 4 5 6 7)))
+(test "(siphash-2-4 string)" 3144613055062689994 (siphash-2-4 key "a"))
+(test "(siphash-2-4 bytevector)" 3144613055062689994 (siphash-2-4 key (u8vector 97)))
 (do ((i 0 (+ i 1)))
     ((= i 64))
   (let ((expected (vector-ref outputs i)))