Skip to content

bug: wrong BlockSize() for poseidon2 #697

@ThomasPiellard

Description

@ThomasPiellard

Description

This code fails ->

fs := poseidon2.NewMerkleDamgardHasher()
	var a [4]byte
	_, err := fs.Write(a[:])
	if err != nil {
		fmt.Println(err)
	}

Expected Behavior

should update the state and Compress correctly

Actual Behavior

When compressing, the code goes there -->

if len(left) != desiredLen || len(right) != desiredLen {
		return nil, fmt.Errorf("left input should be %d bytes", desiredLen)
	}

Metadata

Metadata

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