0xPolygonMiden / crypto

Cryptographic primitives used in Polygon Miden rollup
MIT License
97 stars 32 forks source link

Update RPO's padding rule to use that in the xHash paper #318

Open Al-Kindi-0 opened 3 months ago

Al-Kindi-0 commented 3 months ago

Describe your changes

Checklist before requesting a review

sonarcloud[bot] commented 3 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

Al-Kindi-0 commented 3 months ago

On potential thing left to consider: I believe currently hashing of empty list of elements and hashing of 8 ZERO elements will give us the same result - right? I wonder if there is a good way to fix this - just in case. Nothing immediately comes to mind though.

I think we had a similar discussion in RPO and I believe we settled on not accepting empty lists for hashing. I will think about it again to see if we can accommodate it differently.

bobbinth commented 6 days ago

@Al-Kindi-0 - let's rebase this PR.

Also, should we implement the rule where hashing of an empty string gives us [ZERO; 4] output?

Al-Kindi-0 commented 5 days ago

@Al-Kindi-0 - let's rebase this PR.

Also, should we implement the rule where hashing of an empty string gives us [ZERO; 4] output?

Done!

Al-Kindi-0 commented 3 days ago

Also, it seems like the "return default digest on empty input" as already working here, right?

Yes, had to check the bytes case, but even then it worked without complications

Lastly, could you refresh 0xPolygonMiden/miden-vm#1343 when you get a chance?

Sure thing

sonarcloud[bot] commented 3 days ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud