fedimint_threshold_crypto/cmp_pairing.rs
1use std::cmp::Ordering;
2
3use group::{Curve, Group, GroupEncoding};
4
5// FIXME: probably get rid of this?
6/// Compares two curve elements and returns their `Ordering`.
7pub fn cmp_projective<G>(x: &G, y: &G) -> Ordering where
8 G: Curve,
9 G::AffineRepr: GroupEncoding
10{
11 let xc = x.to_affine().to_bytes();
12 let yc = y.to_affine().to_bytes();
13 xc.as_ref().cmp(yc.as_ref())
14}