perf: adds avx512 poseidon2 for small fields #665
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request includes several changes focused on optimizing and enhancing the cryptographic operations and hash functions. The main changes involve removing redundant macros in assembly files, updating hash function parameters, and adding new test cases for interoperability.
Assembly File Optimizations:
MACC_0,DIV_SHIFT_0,MUL_WORD_0_0, andMUL_WORD_N_0fromecc/bls12-381/internal/fptower/e2_amd64.sand replaced their usage with simplified macros ([[1]](https://github.com/Consensys/gnark-crypto/pull/665/files#diff-144cf2c79d11ebb4bf964e0821b507d5dbf3c5bb32bfbc3f02d8b86749aa216fL560-R572),[[2]](https://github.com/Consensys/gnark-crypto/pull/665/files#diff-144cf2c79d11ebb4bf964e0821b507d5dbf3c5bb32bfbc3f02d8b86749aa216fL677-R641),[[3]](https://github.com/Consensys/gnark-crypto/pull/665/files#diff-144cf2c79d11ebb4bf964e0821b507d5dbf3c5bb32bfbc3f02d8b86749aa216fL800-R704),[[4]](https://github.com/Consensys/gnark-crypto/pull/665/files#diff-144cf2c79d11ebb4bf964e0821b507d5dbf3c5bb32bfbc3f02d8b86749aa216fL892-R748)).New Functions:
sumVec16_AVX512andsumVec24_AVX512functions tofield/asm/element_31b/element_31b_amd64.sfor vector summation using AVX-512 instructions ([field/asm/element_31b/element_31b_amd64.sR99-R132](https://github.com/Consensys/gnark-crypto/pull/665/files#diff-8e2f917b06ecd74bf29565d3563a140e0cabd1d3e9c7adb9678d2c8537e1fa99R99-R132)).Hash Function Updates:
field/babybear/poseidon2/hash.goto improve security ([field/babybear/poseidon2/hash.goL27-R43](https://github.com/Consensys/gnark-crypto/pull/665/files#diff-ed133a4f89b9a8c80359ee0f63d73401cc3a803d8a27dacc89f02c9193c7e0d4L27-R43)).Test Enhancements:
TestPlonky3Interopinfield/babybear/poseidon2/plonky3_interop_test.goto ensure compatibility with Plonky3's Poseidon2 implementation ([field/babybear/poseidon2/plonky3_interop_test.goR1-R228](https://github.com/Consensys/gnark-crypto/pull/665/files#diff-04d598655042c203261b78a63910b43048bb427d3b70651a89c24061a6512310R1-R228)).Miscellaneous:
field/babybear/poseidon2/poseidon2.goto enable optimized paths ([[1]](https://github.com/Consensys/gnark-crypto/pull/665/files#diff-ea2121f32491074cd1a6fae73054e8b1085dc0820d9ceb6bcdcc58f083afe4ddR18),[[2]](https://github.com/Consensys/gnark-crypto/pull/665/files#diff-ea2121f32491074cd1a6fae73054e8b1085dc0820d9ceb6bcdcc58f083afe4ddR51-R62),[[3]](https://github.com/Consensys/gnark-crypto/pull/665/files#diff-ea2121f32491074cd1a6fae73054e8b1085dc0820d9ceb6bcdcc58f083afe4ddR73-R74)).