Skip to content

Commit

Permalink
Set a new bytes used for elliptic curves computations to '\000'
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dinosaure committed Apr 20, 2024
1 parent 47751da commit 3333de3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ec/mirage_crypto_ec.ml
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ end
module Make_field_element (P : Parameters) (F : Foreign) : Field_element = struct
let b_uts b = Bytes.unsafe_to_string b

let create () = Bytes.create P.fe_length
let create () = Bytes.make P.fe_length '\000'

let mul a b =
let tmp = create () in
Expand Down

0 comments on commit 3333de3

Please sign in to comment.