Skip to content

Commit

Permalink
Add panic cases
Browse files Browse the repository at this point in the history
  • Loading branch information
AurelienFT committed Nov 28, 2024
1 parent b10ee84 commit 27afbea
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions src/fuel-vm/instruction-set.md
Original file line number Diff line number Diff line change
Expand Up @@ -2398,8 +2398,16 @@ Panic if:

| `$rB` Curve ID | `$rC` Operation type | `$rA` format | `$rD` format |
|----------------|----------------------|----------------------|----------------------------|
| `0` | `0` | `MEM[$rA, 64]` `1P` | `MEM[$rC, 128]` `1P1P` |
| `0` | `1` | `MEM[$rA, 64]` `1P` | `MEM[$rC, 96]` `1P1S` |
| `0` | `0` | `MEM[$rA, 64]` `1P` | `MEM[$rD, 128]` `1P1P` |
| `0` | `1` | `MEM[$rA, 64]` `1P` | `MEM[$rD, 96]` `1P1S` |

#### Panic cases

- Curve ID is not supported (`$rB`)
- Operation type is not supported (`$rC`)
- `$rD` + (size depending on the table above) overflows or `> VM_MAX_RAM`
- Decoding of `$rD` memory doesn't match the expected format described above for each case.
- The memory range at `$rA` (size depending on the curve/operation types) does not pass [ownership check](./index.md#ownership)

### `EPAR`: Elliptic curve point pairing check

Expand All @@ -2424,6 +2432,14 @@ Panic if:
|---------------------------|----------------------------|
| `0` | `MEM[$rD, (64 + 64 + 64) * $rC]` Each element is `1P1P1P` (three points coordinates) (192 bytes) |

#### Panic cases

- Curve ID/Pairing is not supported (`$rB`)
- `$rD` has elements than described in `$rC`
- `$rD` + (size depending on the table above) overflows or `> VM_MAX_RAM`
- Decoding of `$rD` memory doesn't match the expected format described above for each case.
- The memory range at `$rA` (size depending on the curve/operation types) does not pass [ownership check](./index.md#ownership)

## Other Instructions

All these instructions advance the program counter `$pc` by `4` after performing their operation.
Expand Down

0 comments on commit 27afbea

Please sign in to comment.