Skip to content

Commit 70a559a

Browse files
Updated the specs
1 parent 09d6aa0 commit 70a559a

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

docs/specs/ISA.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This specification describes the overall architecture and default VM extensions
66
- [RV32IM](#rv32im-extension): An extension supporting the 32-bit RISC-V ISA with multiplication.
77
- [Native](#native-extension): An extension supporting native field arithmetic for proof recursion and aggregation.
88
- [Keccak-256](#keccak-extension): An extension implementing the Keccak-256 hash function compatibly with RISC-V memory.
9-
- [SHA2](#sha2-extension): An extension implementing the SHA2-256 and SHA2-512 hash functions compatibly with RISC-V memory.
9+
- [SHA2](#sha2-extension): An extension implementing the SHA-256, SHA-512, and SHA-384 hash functions compatibly with RISC-V memory.
1010
- [BigInt](#bigint-extension): An extension supporting 256-bit signed and unsigned integer arithmetic, including
1111
multiplication. This extension respects the RISC-V memory format.
1212
- [Algebra](#algebra-extension): An extension supporting modular arithmetic over arbitrary fields and their complex
@@ -538,9 +538,9 @@ all memory cells are constrained to be bytes.
538538
| -------------- | ----------- | ----------------------------------------------------------------------------------------------------------------- |
539539
| KECCAK256_RV32 | `a,b,c,1,2` | `[r32{0}(a):32]_2 = keccak256([r32{0}(b)..r32{0}(b)+r32{0}(c)]_2)`. Performs memory accesses with block size `4`. |
540540

541-
### SHA2 Extension
541+
### SHA-2 Extension
542542

543-
The SHA2 extension supports the SHA2-256 and SHA2-512 hash functions. The extension operates on address spaces `1` and `2`,
543+
The SHA-2 extension supports the SHA-256 and SHA-512 hash functions. The extension operates on address spaces `1` and `2`,
544544
meaning all memory cells are constrained to be bytes.
545545

546546
| Name | Operands | Description |

docs/specs/RISCV.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ The default VM extensions that support transpilation are:
55

66
- [RV32IM](#rv32im-extension): An extension supporting the 32-bit RISC-V ISA with multiplication.
77
- [Keccak-256](#keccak-extension): An extension implementing the Keccak-256 hash function compatibly with RISC-V memory.
8-
- [SHA2](#sha2-extension): An extension implementing the SHA2-256 and SHA2-512 hash functions compatibly with RISC-V memory.
8+
- [SHA2](#sha2-extension): An extension implementing the SHA-256, SHA-512, and SHA-384 hash functions compatibly with RISC-V memory.
99
- [BigInt](#bigint-extension): An extension supporting 256-bit signed and unsigned integer arithmetic, including multiplication. This extension respects the RISC-V memory format.
1010
- [Algebra](#algebra-extension): An extension supporting modular arithmetic over arbitrary fields and their complex field extensions. This extension respects the RISC-V memory format.
1111
- [Elliptic curve](#elliptic-curve-extension): An extension for elliptic curve operations over Weierstrass curves, including addition and doubling. This can be used to implement multi-scalar multiplication and ECDSA scalar multiplication. This extension respects the RISC-V memory format.
@@ -78,13 +78,13 @@ the guest must take care to validate all data and account for behavior in cases
7878
| ----------- | --- | ----------- | ------ | ------ | ------------------------------------------- |
7979
| keccak256 | R | 0001011 | 100 | 0x0 | `[rd:32]_2 = keccak256([rs1..rs1 + rs2]_2)` |
8080

81-
## SHA2 Extension
81+
## SHA-2 Extension
8282

8383
| RISC-V Inst | FMT | opcode[6:0] | funct3 | funct7 | RISC-V description and notes |
8484
| ----------- | --- | ----------- | ------ | ------ | ---------------------------------------- |
8585
| sha256 | R | 0001011 | 100 | 0x1 | `[rd:32]_2 = sha256([rs1..rs1 + rs2]_2)` |
86-
| sha512 | R | 0001011 | 100 | 0x2 | `[rd:32]_2 = sha512([rs1..rs1 + rs2]_2)` |
87-
| sha384 | R | 0001011 | 100 | 0x3 | `[rd:32]_2 = sha384([rs1..rs1 + rs2]_2)` |
86+
| sha512 | R | 0001011 | 100 | 0x2 | `[rd:64]_2 = sha512([rs1..rs1 + rs2]_2)` |
87+
| sha384 | R | 0001011 | 100 | 0x3 | `[rd:64]_2 = sha384([rs1..rs1 + rs2]_2)`. Last 16 bytes will be set to zeros. |
8888

8989
## BigInt Extension
9090

docs/specs/isa-table.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,15 +128,15 @@ In the tables below, we provide the mapping between the `LocalOpcode` and `Phant
128128
| ------------- | ---------- | ------------- |
129129
| Keccak | `Rv32KeccakOpcode::KECCAK256` | KECCAK256_RV32 |
130130

131-
## SHA2-256 Extension
131+
## SHA-2 Extension
132132

133133
#### Instructions
134134

135135
| VM Extension | `LocalOpcode` | ISA Instruction |
136136
| ------------- | ---------- | ------------- |
137-
| SHA2-256 | `Rv32Sha2Opcode::SHA256` | SHA256_RV32 |
138-
| SHA2-512 | `Rv32Sha2Opcode::SHA512` | SHA512_RV32 |
139-
| SHA2-384 | `Rv32Sha2Opcode::SHA384` | SHA384_RV32 |
137+
| SHA-2 | `Rv32Sha2Opcode::SHA256` | SHA256_RV32 |
138+
| SHA-2 | `Rv32Sha2Opcode::SHA512` | SHA512_RV32 |
139+
| SHA-2 | `Rv32Sha2Opcode::SHA384` | SHA384_RV32 |
140140

141141
## BigInt Extension
142142

docs/specs/transpiler.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ Each VM extension's behavior is specified below.
151151
| ----------- | -------------------------------------------------- |
152152
| keccak256 | KECCAK256_RV32 `ind(rd), ind(rs1), ind(rs2), 1, 2` |
153153

154-
### SHA2 Extension
154+
### SHA-2 Extension
155155

156156
| RISC-V Inst | OpenVM Instruction |
157157
| ----------- | ----------------------------------------------- |

extensions/sha2/circuit/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ The only difference is that the initial hash state is different.
2929

3030
## Design Overview
3131

32-
We re-use the same AIR code to produce circuits for all three algorithms.
32+
We reuse the same AIR code to produce circuits for all three algorithms.
3333
To achieve this, we parameterize the AIR by constants (such as the word size, number of rounds, and block size) that are specific to each algorithm.
3434

3535
This chip produces an AIR that consists of $R+1$ rows for each block of the message, and no more rows

0 commit comments

Comments
 (0)