diff --git a/src/fuel-vm/instruction-set.md b/src/fuel-vm/instruction-set.md index 373a4445..8f3368af 100644 --- a/src/fuel-vm/instruction-set.md +++ b/src/fuel-vm/instruction-set.md @@ -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: @@ -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: @@ -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).