Skip to content

Pairings can't be added #132

Open
Open
@FilipLaurentiu

Description

@FilipLaurentiu

What happened?

The library can't be used to add pairings result together. This can be helpful for off-chain testing

Code that produced the error

from py_ecc.bn128 import G1, G2, multiply, pairing, add

p1 = pairing(G2, multiply(G1, 4))
p2 = pairing(multiply(G2, 4), G1)
p3 = pairing(G2, multiply(G1, 8))


assert p1 == p2, "Fail 1"
assert add(p1, p2) == p3, "Fail 2"

Full error output

python3.9/site-packages/py_ecc/bn128/bn128_curve.py", line 87, in add
    x1, y1 = p1
TypeError: cannot unpack non-iterable bn128_FQ12 object

Fill this section in if you know how this could or should be fixed

No response

py-ecc Version

6.0.0

Python Version

3.9

Operating System

linux

Output from pip freeze

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions