ecc

package
v0.0.0-...-ebe581b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 22, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ECPoint

type ECPoint struct {
	CurveName string
	X, Y      *big.Int
}

type Point

type Point struct {
	Curve elliptic.Curve
	X     *big.Int
	Y     *big.Int
}

Point 定义椭圆曲线上的点

func NewPoint

func NewPoint(curve elliptic.Curve, x, y *big.Int) (*Point, error)

NewPoint 根据坐标和曲线类型构造Point

func (*Point) Add

func (p *Point) Add(p1 *Point) (*Point, error)

Add 计算两个点的加法

func (*Point) Equals

func (p *Point) Equals(p1 *Point) bool

Equals 判断两个点是否相同

func (*Point) ScalarMult

func (p *Point) ScalarMult(k *big.Int) *Point

ScalarMult 计算一个点的数乘

func (*Point) ToString

func (p *Point) ToString() (string, error)

ToString 将Point转换为string类型

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL