Skip to content

Commit

Permalink
Merge branch 'master' into dento/blob-tx
Browse files Browse the repository at this point in the history
  • Loading branch information
Dentosal authored Jul 31, 2024
2 parents 79f0a54 + 6ebbe21 commit df9028c
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/fuel-vm/instruction-set.md
Original file line number Diff line number Diff line change
Expand Up @@ -2267,7 +2267,7 @@ All these instructions advance the program counter `$pc` by `4` after performing
| Operation | ```MEM[$rA, 64] = ecrecover_k1(MEM[$rB, 64], MEM[$rC, 32]);``` |
| Syntax | `eck1 $rA, $rB, $rC` |
| Encoding | `0x00 rA rB rC -` |
| Notes | |
| Notes | Takes message hash as an input. You can use `S256` to hash the message if needed. |

Panic if:

Expand All @@ -2290,7 +2290,7 @@ To get the address from the public key, hash the public key with [SHA-2-256](../
| Operation | ```MEM[$rA, 64] = ecrecover_r1(MEM[$rB, 64], MEM[$rC, 32]);``` |
| Syntax | `ecr1 $rA, $rB, $rC` |
| Encoding | `0x00 rA rB rC -` |
| Notes | |
| Notes | Takes message hash as an input. You can use `S256` to hash the message if needed. |

Panic if:

Expand All @@ -2307,19 +2307,19 @@ To get the address from the public key, hash the public key with [SHA-2-256](../

### `ED19`: EdDSA curve25519 verification

| | |
|-------------|-----------------------------------------------------------------------------------------------------------------------------------------------------|
| Description | Verification recovered from 32-byte public key starting at `$rA` and 64-byte signature starting at `$rB` on 32-byte message hash starting at `$rC`. |
| Operation | ```ed19verify(MEM[$rA, 32], MEM[$rB, 64], MEM[$rC, 32]);``` |
| Syntax | `ed19 $rA, $rB, $rC` |
| Encoding | `0x00 rA rB rC -` |
| Notes | |
| | |
|-------------|-----------------------------------------------------------------------------------------------------------------------------|
| Description | Verification 64-byte signature at `$rB` with 32-byte public key at `$rA` for a message starting at `$rC` with length `$rD`. |
| Operation | ```ed19verify(MEM[$rA, 32], MEM[$rB, 64], MEM[$rC, $rD]);``` |
| Syntax | `ed19 $rA, $rB, $rC, $rD` |
| Encoding | `0x00 rA rB rC rD` |
| Notes | Takes message instead of hash. **For backwards compatibility reasons, if `$rD == 0`, it will be treated as `32`.** |

Panic if:

- `$rA + 32` overflows or `> VM_MAX_RAM`
- `$rB + 64` overflows or `> VM_MAX_RAM`
- `$rC + 32` overflows or `> VM_MAX_RAM`
- `$rC + $rD` overflows or `> VM_MAX_RAM`

Verification are specified [here](../protocol/cryptographic-primitives.md#eddsa-public-key-cryptography).

Expand Down

0 comments on commit df9028c

Please sign in to comment.