sm2

package
v0.0.0-...-d9d7dc4 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package elliptic implements several standard elliptic curves over prime fields.

Package elliptic implements several standard elliptic curves over prime fields.

Package elliptic implements several standard elliptic curves over prime fields.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BarrettDiv

func BarrettDiv(prod, mu *big.Int) (r *big.Int)

func CalcMu

func CalcMu(p *big.Int) *big.Int

CalcMu mu = b^2k / p

func DiffInt

func DiffInt(x, y *big.Int) (delta int64, err error)

func Marshal

func Marshal(curve Curve, x, y *big.Int) []byte

Marshal converts a point into the uncompressed form specified in section 4.3.6 of ANSI X9.62.

func RecoverPoint

func RecoverPoint(x1 *big.Int, v uint) (y1 *big.Int, err error)

func SM2asm

func SM2asm() p256Curve

func Unmarshal

func Unmarshal(curve Curve, data []byte) (x, y *big.Int)

Unmarshal converts a point, serialized by Marshal, into an x, y pair. It is an error if the point is not in uncompressed form or is not on the curve. On error, x = nil.

Types

type Curve

type Curve = elliptic.Curve

A Curve represents a short-form Weierstrass curve with a=-3. See https://www.hyperelliptic.org/EFD/g1p/auto-shortw.html

func BTC

func BTC() Curve

func P256

func P256() Curve

P256 returns a Curve which implements sm2 via elliptic package

The cryptographic operations do not use constant-time algorithms.

func SM2

func SM2() Curve

SM2 returns a Curve which implements sm2

The cryptographic operations are implemented using constant-time algorithms.

func SM2go

func SM2go() Curve

type CurveParams

type CurveParams = elliptic.CurveParams

CurveParams contains the parameters of an elliptic curve and also provides a generic, non-constant time implementation of Curve.

Jump to

Keyboard shortcuts

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