bn256

package
v0.0.0-...-92cc422 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2019 License: GPL-3.0, BSD-3-Clause, BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Overview

此源码被清华学神尹成大魔王专业翻译分析并修改 尹成QQ77025077 尹成微信18510341407 尹成所在QQ群721929980 尹成邮箱 yinc13@mails.tsinghua.edu.cn 尹成毕业于清华大学,微软区块链领域全球最有价值专家 https://mvp.microsoft.com/zh-cn/PublicProfile/4033620 包BN256以128位安全性实现特定的双线性组 水平。

双线性群是许多新的密码协议的基础 在过去的十年中被提议。它们由三组组成 (g_、g櫒和gt)这样就存在一个函数e(g_,g櫒)=gt_(其中g_ 是相应组的生成器)。这个函数称为配对 功能。

这个包专门实现了256位以上的最佳ATE配对 Barreto-Naehrig曲线,如中所述 http://cryptojedi.org/papers/dclxvi-20100714.pdf.它的输出是兼容的 以及本文中描述的实现。

此源码被清华学神尹成大魔王专业翻译分析并修改 尹成QQ77025077 尹成微信18510341407 尹成所在QQ群721929980 尹成邮箱 yinc13@mails.tsinghua.edu.cn 尹成毕业于清华大学,微软区块链领域全球最有价值专家 https://mvp.microsoft.com/zh-cn/PublicProfile/4033620

此源码被清华学神尹成大魔王专业翻译分析并修改 尹成QQ77025077 尹成微信18510341407 尹成所在QQ群721929980 尹成邮箱 yinc13@mails.tsinghua.edu.cn 尹成毕业于清华大学,微软区块链领域全球最有价值专家 https://mvp.microsoft.com/zh-cn/PublicProfile/4033620

此源码被清华学神尹成大魔王专业翻译分析并修改 尹成QQ77025077 尹成微信18510341407 尹成所在QQ群721929980 尹成邮箱 yinc13@mails.tsinghua.edu.cn 尹成毕业于清华大学,微软区块链领域全球最有价值专家 https://mvp.microsoft.com/zh-cn/PublicProfile/4033620

此源码被清华学神尹成大魔王专业翻译分析并修改 尹成QQ77025077 尹成微信18510341407 尹成所在QQ群721929980 尹成邮箱 yinc13@mails.tsinghua.edu.cn 尹成毕业于清华大学,微软区块链领域全球最有价值专家 https://mvp.microsoft.com/zh-cn/PublicProfile/4033620

此源码被清华学神尹成大魔王专业翻译分析并修改 尹成QQ77025077 尹成微信18510341407 尹成所在QQ群721929980 尹成邮箱 yinc13@mails.tsinghua.edu.cn 尹成毕业于清华大学,微软区块链领域全球最有价值专家 https://mvp.microsoft.com/zh-cn/PublicProfile/4033620

此源码被清华学神尹成大魔王专业翻译分析并修改 尹成QQ77025077 尹成微信18510341407 尹成所在QQ群721929980 尹成邮箱 yinc13@mails.tsinghua.edu.cn 尹成毕业于清华大学,微软区块链领域全球最有价值专家 https://mvp.microsoft.com/zh-cn/PublicProfile/4033620

此源码被清华学神尹成大魔王专业翻译分析并修改 尹成QQ77025077 尹成微信18510341407 尹成所在QQ群721929980 尹成邮箱 yinc13@mails.tsinghua.edu.cn 尹成毕业于清华大学,微软区块链领域全球最有价值专家 https://mvp.microsoft.com/zh-cn/PublicProfile/4033620

此源码被清华学神尹成大魔王专业翻译分析并修改 尹成QQ77025077 尹成微信18510341407 尹成所在QQ群721929980 尹成邮箱 yinc13@mails.tsinghua.edu.cn 尹成毕业于清华大学,微软区块链领域全球最有价值专家 https://mvp.microsoft.com/zh-cn/PublicProfile/4033620

Index

Constants

This section is empty.

Variables

View Source
var Order = bigFromBase10("21888242871839275222246405745257275088548364400416034343698204186575808495617")

order是G_和G癓中的元素数:36U_+36U³+18U²+6U+1。

View Source
var P = bigFromBase10("21888242871839275222246405745257275088696311157297823662689037894645226208583")

P是一个基本字段:36U_+36U³+24U²+6U+1。

Functions

func PairingCheck

func PairingCheck(a []*G1, b []*G2) bool

pairingcheck计算一组点的最佳ate对。

Types

type G1

type G1 struct {
	// contains filtered or unexported fields
}

g1是一个抽象的循环群。零值适合用作 操作的输出,但不能用作输入。

func RandomG1

func RandomG1(r io.Reader) (*big.Int, *G1, error)

randomg1返回x和g_,其中x是从r读取的随机非零数字。

func (*G1) Add

func (e *G1) Add(a, b *G1) *G1

将集合e添加到a+b,然后返回e。

func (*G1) Marshal

func (e *G1) Marshal() []byte

封送将E转换为字节片。

func (*G1) Neg

func (e *G1) Neg(a *G1) *G1

neg将e设置为-a,然后返回e。

func (*G1) ScalarBaseMult

func (e *G1) ScalarBaseMult(k *big.Int) *G1

scalarbasemult将e设置为g*k,其中g是组的生成器,然后 返回E

func (*G1) ScalarMult

func (e *G1) ScalarMult(a *G1, k *big.Int) *G1

scalarmult将e设置为*k,然后返回e。

func (*G1) Set

func (e *G1) Set(a *G1) *G1

将e设置为a,然后返回e。

func (*G1) String

func (g *G1) String() string

func (*G1) Unmarshal

func (e *G1) Unmarshal(m []byte) ([]byte, error)

unmarshal将e设置为将marshal的输出转换回 一个group元素,然后返回e。

type G2

type G2 struct {
	// contains filtered or unexported fields
}

g2是一个抽象的循环群。零值适合用作 操作的输出,但不能用作输入。

func RandomG2

func RandomG2(r io.Reader) (*big.Int, *G2, error)

randomg2返回x和g,其中x是从r读取的随机非零数字。

func (*G2) Add

func (e *G2) Add(a, b *G2) *G2

将集合e添加到a+b,然后返回e。

func (*G2) Marshal

func (e *G2) Marshal() []byte

封送将E转换为字节片。

func (*G2) Neg

func (e *G2) Neg(a *G2) *G2

neg将e设置为-a,然后返回e。

func (*G2) ScalarBaseMult

func (e *G2) ScalarBaseMult(k *big.Int) *G2

scalarbasemult将e设置为g*k,其中g是组的生成器,然后 退回。

func (*G2) ScalarMult

func (e *G2) ScalarMult(a *G2, k *big.Int) *G2

scalarmult将e设置为*k,然后返回e。

func (*G2) Set

func (e *G2) Set(a *G2) *G2

将e设置为a,然后返回e。

func (*G2) String

func (e *G2) String() string

func (*G2) Unmarshal

func (e *G2) Unmarshal(m []byte) ([]byte, error)

unmarshal将e设置为将marshal的输出转换回 一个group元素,然后返回e。

type GT

type GT struct {
	// contains filtered or unexported fields
}

gt是一个抽象循环群。零值适合用作 操作的输出,但不能用作输入。

func Miller

func Miller(g1 *G1, g2 *G2) *GT

Miller应用Miller算法,它是 源组到f_p^12。Miller(g1,g2).Finalize()等价于pair(g1,g2)。 G2)。

func Pair

func Pair(g1 *G1, g2 *G2) *GT

配对计算最佳ATE配对。

func (*GT) Add

func (e *GT) Add(a, b *GT) *GT

将集合e添加到a+b,然后返回e。

func (*GT) Finalize

func (e *GT) Finalize() *GT

Finalize是一个从f_p^12到gt的线性函数。

func (*GT) Marshal

func (e *GT) Marshal() []byte

封送将E转换为字节片。

func (*GT) Neg

func (e *GT) Neg(a *GT) *GT

neg将e设置为-a,然后返回e。

func (*GT) ScalarMult

func (e *GT) ScalarMult(a *GT, k *big.Int) *GT

scalarmult将e设置为*k,然后返回e。

func (*GT) Set

func (e *GT) Set(a *GT) *GT

将e设置为a,然后返回e。

func (*GT) String

func (g *GT) String() string

func (*GT) Unmarshal

func (e *GT) Unmarshal(m []byte) ([]byte, error)

unmarshal将e设置为将marshal的输出转换回 一个group元素,然后返回e。

Jump to

Keyboard shortcuts

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