(foreign-declare "#include \"implementations/blowfish/gensalt_blowfish.c\"") (define crypt-blowfish-default-logrounds (make-parameter 12)) (define (crypt-blowfish-gensalt random #!key rounds) (let ((output (make-string 29))) (if ((foreign-lambda c-pointer "_crypt_gensalt_blowfish_rn" unsigned-long u8vector int scheme-pointer int) (or rounds (crypt-blowfish-default-logrounds)) (get-random-u8vector 'crypt-blowfish-gensalt random 16 16) 16 output 29) output ;; TODO: implement proper error handling (error "Error generating blowfish salt"))))