File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -452,6 +452,31 @@ impl EcPointRef {
452452 }
453453 }
454454
455+ /// Returns `true` if `self` is the point at infinity and `false` otherwise.
456+ #[ corresponds( EC_POINT_is_at_infinity ) ]
457+ #[ must_use]
458+ pub fn is_infinity ( & self , group : & EcGroupRef ) -> bool {
459+ unsafe { ffi:: EC_POINT_is_at_infinity ( group. as_ptr ( ) , self . as_ptr ( ) ) == 1 }
460+ }
461+
462+ /// Returns `Ok(true)` if `self` is an element of `group` and `Ok(false)` otherwise.
463+ /// `ctx` is ignored. This method exists for rust-openssl interoperability.
464+ #[ corresponds( EC_POINT_is_on_curve ) ]
465+ #[ doc( hidden) ]
466+ pub fn is_on_curve (
467+ & self ,
468+ group : & EcGroupRef ,
469+ ctx : & mut BigNumContextRef ,
470+ ) -> Result < bool , ErrorStack > {
471+ unsafe {
472+ let res = cvt_n ( ffi:: EC_POINT_is_on_curve (
473+ group. as_ptr ( ) ,
474+ self . as_ptr ( ) ,
475+ ctx. as_ptr ( ) ,
476+ ) ) ?;
477+ Ok ( res == 1 )
478+ }
479+ }
455480}
456481
457482impl EcPoint {
You can’t perform that action at this time.
0 commit comments