As calldata is charged 0.128 gas / felt on Starknet and all curves except BLS has 3 limbs that are non zero, we can save 25% of calldata cost (and also deserialization cost) by assuming the 4th limb is 0 for all curve_ids except BLS12-381.
This require :
Changes on the calldata builders in python & rust
Specific deserialization of u384 based on the curve ID in Cairo.
Updates to groth16 and ECIP contracts. Likely this implies changing the signature of calldata to a single felt252 array + curve id.
As calldata is charged 0.128 gas / felt on Starknet and all curves except BLS has 3 limbs that are non zero, we can save 25% of calldata cost (and also deserialization cost) by assuming the 4th limb is 0 for all curve_ids except BLS12-381.
This require :