Convert the representation of a secp256k1 point
from secp256k1-point to
(secp256k1-point-to-pointp secp-point) → point
Function:
(defun secp256k1-point-to-pointp (secp-point) (declare (xargs :guard (secp256k1-pointp secp-point))) (let ((acl2::__function__ 'secp256k1-point-to-pointp)) (declare (ignorable acl2::__function__)) (b* ((x (secp256k1-point->x secp-point)) (y (secp256k1-point->y secp-point))) (if (and (= x 0) (= y 0)) :infinity (cons x y)))))
Theorem:
(defthm pointp-of-secp256k1-point-to-pointp (b* ((point (secp256k1-point-to-pointp secp-point))) (pointp point)) :rule-classes :rewrite)
Theorem:
(defthm point-in-pxp-p-of-secp256k1-point-to-pointp (point-in-pxp-p (secp256k1-point-to-pointp secp-point) (secp256k1-field-prime)))
Theorem:
(defthm secp256k1-point-to-pointp-of-secp256k1-point-fix-secp-point (equal (secp256k1-point-to-pointp (secp256k1-point-fix secp-point)) (secp256k1-point-to-pointp secp-point)))
Theorem:
(defthm secp256k1-point-to-pointp-secp256k1-point-equiv-congruence-on-secp-point (implies (secp256k1-point-equiv secp-point secp-point-equiv) (equal (secp256k1-point-to-pointp secp-point) (secp256k1-point-to-pointp secp-point-equiv))) :rule-classes :congruence)