feat: new pointToHash as per EIP-6800

This commit is contained in:
advaita-saha 2024-04-02 03:14:52 +05:30
parent b5812e6ab5
commit 837427902f
No known key found for this signature in database
GPG Key ID: 33CFA1C66B77807C
1 changed files with 6 additions and 1 deletions

View File

@ -84,4 +84,9 @@ func serializePoint*(point: Point): Bytes32 =
assert result.serialize(point) == CttCodecEccStatus.cttCodecEcc_Success
func zeroField*(): Field =
result.setZero()
result.setZero()
func hashPointToBytes*(point: Point): Bytes32 =
var hashedPoint: Field
hashedPoint.mapToScalarField(point)
assert result.marshal(hashedPoint, littleEndian)