Skip to content

Commit

Permalink
drop monocypher dep
Browse files Browse the repository at this point in the history
  • Loading branch information
vbmithr committed Feb 14, 2020
1 parent bde11bd commit 6643e69
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
1 change: 0 additions & 1 deletion fix-deribit.opam
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ depends: [
"rresult" {>= "0.6.0"}
"ptime" {>= "0.8.5"}
"base64" {>= "3.2.0"}
"monocypher" {= version}
"sexplib" {>= "v0.12.0"}
"digestif" {>= "0.8.0"}
"uri" {>= "3.1.0"}
Expand Down
1 change: 0 additions & 1 deletion src/dune
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
rresult
ptime
base64
monocypher
sexplib
digestif.c
uri))
Expand Down
8 changes: 7 additions & 1 deletion src/fix_deribit.ml
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,14 @@ let logon_fields
~username
~secret
~ts =
let rand () = Random.int64 Int64.max_int in
let buf = Bytes.create 32 in
Bytes.set_int64_ne buf 0 (rand ()) ;
Bytes.set_int64_ne buf 8 (rand ()) ;
Bytes.set_int64_ne buf 16 (rand ()) ;
Bytes.set_int64_ne buf 24 (rand ()) ;
let b64rand =
Base64.encode_exn (Monocypher.Rand.gen 32 |> Bigstring.to_string) in
Base64.encode_exn (Bytes.unsafe_to_string buf) in
let rawdata =
Format.asprintf "%.0f.%s" (Ptime.to_float_s ts *. 1e3) b64rand in
let password =
Expand Down

0 comments on commit 6643e69

Please sign in to comment.