Discover Packages
github.com/olegfomenko/crypto
go
ec
package
Version:
v0.0.0-...-ee1bab5
Opens a new window with list of versions in this module.
Published: Apr 12, 2024
License: MIT
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
README
¶
Elliptic curve
This package contains Go (only) implementation of elliptic curve with equation: y^2 =x^3 + ax + b. It also implements
the standard
Go elliptic.Curve
interface.
The SECP256K1()
function returns curve instance with parameters
from SEC 2: Recommended Elliptic Curve Domain Parameters .
In the tests you can find the comparison of this implementation and popular Ethereum implementation.
More about (Wiki)
Expand ▾
Collapse ▴
Documentation
¶
Package ec
Copyright 2023 Oleg Fomenko. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
type Curve
func (c *Curve) Add(x1, y1, x2, y2 *big.Int) (x, y *big.Int)
func (c *Curve) Double(x1, y1 *big.Int) (x, y *big.Int)
func (c *Curve) IsOnCurve(x, y *big.Int) bool
func (c *Curve) Params() *elliptic.CurveParams
func (c *Curve) ScalarBaseMult(k []byte) (x, y *big.Int)
func (c *Curve) ScalarMult(x1, y1 *big.Int, k []byte) (x, y *big.Int)
Curve implements elliptic curve with equation: y^2 =x^3 + ax + b
SECP256K1 returns an Ethereum secp256k1 curve
Source Files
¶
Click to show internal directories.
Click to hide internal directories.