Skip to content

Commit

Permalink
When comparing Field.t values, avoid the conversion to bigint
Browse files Browse the repository at this point in the history
  • Loading branch information
tizoc committed Nov 22, 2023
1 parent 97e6b95 commit 3c6eb58
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/lib/crypto/kimchi_backend/common/field.ml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ module type Input_intf = sig

val is_square : t -> bool

val compare : t -> t -> int

val equal : t -> t -> bool

val print : t -> unit
Expand Down Expand Up @@ -194,7 +196,7 @@ module Make (F : Input_intf) :

let hash = Hash.of_fold hash_fold_t

let compare t1 t2 = Bigint.compare (to_bigint t1) (to_bigint t2)
let compare = compare

let equal = equal

Expand Down
4 changes: 2 additions & 2 deletions src/lib/crypto/kimchi_backend/kimchi_backend.mli
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ module Kimchi_backend_common : sig

val sexp_of_t : t -> Sexplib0.Sexp.t

val compare : t -> t -> int

val bin_size_t : t Bin_prot.Size.sizer

val bin_write_t : t Bin_prot.Write.writer
Expand Down Expand Up @@ -56,6 +54,8 @@ module Kimchi_backend_common : sig

val is_square : t -> bool

val compare : t -> t -> int

val equal : t -> t -> bool

val print : t -> unit
Expand Down

0 comments on commit 3c6eb58

Please sign in to comment.