Skip to content

Commit 3333de3

Browse files
committed
Set a new bytes used for elliptic curves computations to '\000'
Cstruct.create does this. If we don't initialize bytes with '\000', Field_element.zero can be something else than '\000'. It's a fix for mirleft/ocaml-x509#167.
1 parent 47751da commit 3333de3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ec/mirage_crypto_ec.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ end
135135
module Make_field_element (P : Parameters) (F : Foreign) : Field_element = struct
136136
let b_uts b = Bytes.unsafe_to_string b
137137

138-
let create () = Bytes.create P.fe_length
138+
let create () = Bytes.make P.fe_length '\000'
139139

140140
let mul a b =
141141
let tmp = create () in

0 commit comments

Comments
 (0)