Created
March 8, 2011 21:11
-
-
Save zbroyar/861072 to your computer and use it in GitHub Desktop.
Sign a message with OCaml Cryptokit sha256 & RSA
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let (>>) x f = f x ;; | |
let hash = hash_string (Hash.sha256()) ;; | |
let sign_of_message key msg = | |
msg >> hash >> | |
(pkcs1v1pad key) >> | |
(RSA.sign key) >> | |
strrev | |
;; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment