From 4ed51340fa29e62792ae0215ee4498f9e8ba8eab Mon Sep 17 00:00:00 2001 From: Woods Date: Wed, 15 May 2024 16:40:59 +0800 Subject: [PATCH] check initialized of point --- .idea/workspace.xml | 59 +++++++++++++++++++++++++++++++++++++++++++++ edwards25519.go | 7 ++++++ 2 files changed, 66 insertions(+) create mode 100644 .idea/workspace.xml diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..65246ec --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,59 @@ + + + + + + + + + + + + + { + "associatedIndex": 1 +} + + + + + + + + + + + + + + + true + + \ No newline at end of file diff --git a/edwards25519.go b/edwards25519.go index a744da2..b9513a8 100644 --- a/edwards25519.go +++ b/edwards25519.go @@ -46,6 +46,13 @@ func checkInitialized(points ...*Point) { } } +func (v *Point) CheckInitialized() bool { + if v.x == (field.Element{}) && v.y == (field.Element{}) { + return false + } + return true +} + type projCached struct { YplusX, YminusX, Z, T2d field.Element }