|
161 | 161 | * // Cost of performing BLS12-381 scalar element exponentiation |
162 | 162 | * Bls12381FrPow = 68, |
163 | 163 | * // Cost of performing BLS12-381 scalar element inversion |
164 | | - * Bls12381FrInv = 69 |
| 164 | + * Bls12381FrInv = 69, |
| 165 | + * |
| 166 | + * // Cost of encoding a BN254 Fp (base field element) |
| 167 | + * Bn254EncodeFp = 70, |
| 168 | + * // Cost of decoding a BN254 Fp (base field element) |
| 169 | + * Bn254DecodeFp = 71, |
| 170 | + * // Cost of checking a G1 point lies on the curve |
| 171 | + * Bn254G1CheckPointOnCurve = 72, |
| 172 | + * // Cost of checking a G2 point lies on the curve |
| 173 | + * Bn254G2CheckPointOnCurve = 73, |
| 174 | + * // Cost of checking a G2 point belongs to the correct subgroup |
| 175 | + * Bn254G2CheckPointInSubgroup = 74, |
| 176 | + * // Cost of converting a BN254 G1 point from projective to affine coordinates |
| 177 | + * Bn254G1ProjectiveToAffine = 75, |
| 178 | + * // Cost of performing BN254 G1 point addition |
| 179 | + * Bn254G1Add = 76, |
| 180 | + * // Cost of performing BN254 G1 scalar multiplication |
| 181 | + * Bn254G1Mul = 77, |
| 182 | + * // Cost of performing BN254 pairing operation |
| 183 | + * Bn254Pairing = 78, |
| 184 | + * // Cost of converting a BN254 scalar element from U256 |
| 185 | + * Bn254FrFromU256 = 79, |
| 186 | + * // Cost of converting a BN254 scalar element to U256 |
| 187 | + * Bn254FrToU256 = 80, |
| 188 | + * // // Cost of performing BN254 scalar element addition/subtraction |
| 189 | + * Bn254FrAddSub = 81, |
| 190 | + * // Cost of performing BN254 scalar element multiplication |
| 191 | + * Bn254FrMul = 82, |
| 192 | + * // Cost of performing BN254 scalar element exponentiation |
| 193 | + * Bn254FrPow = 83, |
| 194 | + * // Cost of performing BN254 scalar element inversion |
| 195 | + * Bn254FrInv = 84 |
165 | 196 | * }; |
166 | 197 | * </pre> |
167 | 198 | */ |
@@ -235,7 +266,22 @@ public enum ContractCostType implements XdrElement { |
235 | 266 | Bls12381FrAddSub(66), |
236 | 267 | Bls12381FrMul(67), |
237 | 268 | Bls12381FrPow(68), |
238 | | - Bls12381FrInv(69); |
| 269 | + Bls12381FrInv(69), |
| 270 | + Bn254EncodeFp(70), |
| 271 | + Bn254DecodeFp(71), |
| 272 | + Bn254G1CheckPointOnCurve(72), |
| 273 | + Bn254G2CheckPointOnCurve(73), |
| 274 | + Bn254G2CheckPointInSubgroup(74), |
| 275 | + Bn254G1ProjectiveToAffine(75), |
| 276 | + Bn254G1Add(76), |
| 277 | + Bn254G1Mul(77), |
| 278 | + Bn254Pairing(78), |
| 279 | + Bn254FrFromU256(79), |
| 280 | + Bn254FrToU256(80), |
| 281 | + Bn254FrAddSub(81), |
| 282 | + Bn254FrMul(82), |
| 283 | + Bn254FrPow(83), |
| 284 | + Bn254FrInv(84); |
239 | 285 |
|
240 | 286 | private final int value; |
241 | 287 |
|
@@ -392,6 +438,36 @@ public static ContractCostType decode(XdrDataInputStream stream, int maxDepth) |
392 | 438 | return Bls12381FrPow; |
393 | 439 | case 69: |
394 | 440 | return Bls12381FrInv; |
| 441 | + case 70: |
| 442 | + return Bn254EncodeFp; |
| 443 | + case 71: |
| 444 | + return Bn254DecodeFp; |
| 445 | + case 72: |
| 446 | + return Bn254G1CheckPointOnCurve; |
| 447 | + case 73: |
| 448 | + return Bn254G2CheckPointOnCurve; |
| 449 | + case 74: |
| 450 | + return Bn254G2CheckPointInSubgroup; |
| 451 | + case 75: |
| 452 | + return Bn254G1ProjectiveToAffine; |
| 453 | + case 76: |
| 454 | + return Bn254G1Add; |
| 455 | + case 77: |
| 456 | + return Bn254G1Mul; |
| 457 | + case 78: |
| 458 | + return Bn254Pairing; |
| 459 | + case 79: |
| 460 | + return Bn254FrFromU256; |
| 461 | + case 80: |
| 462 | + return Bn254FrToU256; |
| 463 | + case 81: |
| 464 | + return Bn254FrAddSub; |
| 465 | + case 82: |
| 466 | + return Bn254FrMul; |
| 467 | + case 83: |
| 468 | + return Bn254FrPow; |
| 469 | + case 84: |
| 470 | + return Bn254FrInv; |
395 | 471 | default: |
396 | 472 | throw new IllegalArgumentException("Unknown enum value: " + value); |
397 | 473 | } |
|
0 commit comments