mirror of
https://github.com/logos-blockchain/logos-blockchain-specs.git
synced 2026-01-05 14:43:11 +00:00
crypto: make sure prf returns field elements, fix ECC math in pedcom
This commit is contained in:
parent
189ab5240d
commit
7405b31378
@ -51,8 +51,10 @@ def poseidon_grumpkin_field():
|
||||
POSEIDON = poseidon_grumpkin_field()
|
||||
|
||||
|
||||
def prf(domain, *elements):
|
||||
return POSEIDON([*_str_to_vec(domain), *elements])
|
||||
def prf(domain, *elements) -> Field:
|
||||
return Field(int(POSEIDON([*_str_to_vec(domain), *elements])))
|
||||
|
||||
|
||||
|
||||
|
||||
def comm(*elements):
|
||||
@ -65,7 +67,7 @@ def comm(*elements):
|
||||
|
||||
|
||||
def pederson_commit(value: Field, blinding: Field, domain: Point) -> Point:
|
||||
return value * Point.generator() + blinding * domain
|
||||
return Point.generator().mul(value) + domain.mul(blinding)
|
||||
|
||||
|
||||
def merkle_root(data) -> Field:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user