mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-25 14:16:44 +00:00
remove optimization
This commit is contained in:
parent
103d398e48
commit
2f98aee459
2 changed files with 0 additions and 11 deletions
|
|
@ -78,11 +78,6 @@ func (g *G1) Unmarshal(buf []byte) (int, error) {
|
||||||
func (p *G1) Marshal() []byte {
|
func (p *G1) Marshal() []byte {
|
||||||
output := make([]byte, 64)
|
output := make([]byte, 64)
|
||||||
|
|
||||||
// Handle point at infinity
|
|
||||||
if p.inner.X.IsZero() && p.inner.Y.IsZero() {
|
|
||||||
return output
|
|
||||||
}
|
|
||||||
|
|
||||||
xBytes := p.inner.X.Bytes()
|
xBytes := p.inner.X.Bytes()
|
||||||
copy(output[:32], xBytes[:])
|
copy(output[:32], xBytes[:])
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -77,12 +77,6 @@ func (g *G2) Unmarshal(buf []byte) (int, error) {
|
||||||
func (g *G2) Marshal() []byte {
|
func (g *G2) Marshal() []byte {
|
||||||
output := make([]byte, 128)
|
output := make([]byte, 128)
|
||||||
|
|
||||||
// Handle point at infinity
|
|
||||||
if g.inner.X.A0.IsZero() && g.inner.X.A1.IsZero() &&
|
|
||||||
g.inner.Y.A0.IsZero() && g.inner.Y.A1.IsZero() {
|
|
||||||
return output
|
|
||||||
}
|
|
||||||
|
|
||||||
xA0Bytes := g.inner.X.A0.Bytes()
|
xA0Bytes := g.inner.X.A0.Bytes()
|
||||||
copy(output[:32], xA0Bytes[:])
|
copy(output[:32], xA0Bytes[:])
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue