diff --git a/documentation/aleo/03_language.md b/documentation/aleo/03_language.md index 8689e11cc..4a5631ac2 100644 --- a/documentation/aleo/03_language.md +++ b/documentation/aleo/03_language.md @@ -238,7 +238,7 @@ A struct is a data type declared as `struct {name}:`. Structs contain component declarations `{name} as {type}`. ```aleo showLineNumbers -struct array3: +struct rgb: a0 as u32; a1 as u32; a2 as u32; @@ -247,11 +247,11 @@ struct array3: To instantiate a `struct` in a program use the `cast` instruction. ```aleo showLineNumbers -function new_array3: +function new_rgb: input r0 as u32.private; input r1 as u32.private; input r2 as u32.private; - cast r0 r1 r2 into r3 as array3; + cast r0 r1 r2 into r3 as rgb; output r3; ``` diff --git a/documentation/aleo/04_opcodes.md b/documentation/aleo/04_opcodes.md index 351f7b77f..78a99268d 100644 --- a/documentation/aleo/04_opcodes.md +++ b/documentation/aleo/04_opcodes.md @@ -39,10 +39,10 @@ The following lists show the standard and cryptographic opcodes supported by Ale | [nor](#nor) | `Boolean` NOR operation | | [not](#not) | NOT operation | | [or](#or) | OR Operation | -| [position](#position) | The position command | +| [position](#position) | Mark a possible branch target | | [pow](#pow) | Exponentiation operation | | [pow.w](#poww) | Wrapping exponentiation operation | -| [rand.chacha](#randchacha) | Generates a random value within the `finalize` scope. | +| [rand.chacha](#randchacha) | Generates a random value | | [rem](#rem) | Remainder operation | | [rem.w](#remw) | Wrapping remainder operation | | [shl](#shl) | Shift left operation | @@ -94,7 +94,7 @@ The following is the specification for each opcode in the Aleo Virtual Machine ( Computes the absolute value of the input, checking for overflow, storing the result in the destination register. -For integer types, a constraint is added to check for underflow. For cases where wrapping semantics are needed, see the [abs.w](#abs.w) instruction. This underflow happens when the input is the minimum value of a signed integer type. For example, `abs -128i8` would result in underflow, since `128` cannot be represented as an `i8`. +For integer types, a constraint is added to check for overflow. For cases where wrapping semantics are needed, see the [abs.w](#abs.w) instruction. This overflow happens when the input is the minimum value of a signed integer type. For example, `abs -128i8` would result in overflow, since `128` cannot be represented as an `i8`. #### Supported Types @@ -114,7 +114,7 @@ For integer types, a constraint is added to check for underflow. For cases where #### Description -Compute the absolute value of the input, wrapping around at the boundary of the type, and storing the result in the destination register. +Compute the absolute value of the input, wrapping around at the boundary of the type, and storing the result in the destination register. `abs.w -128i8` executes normally, the result is 0 (`abs -128i8` run was interrupted). #### Supported Types @@ -1771,13 +1771,13 @@ Shifts `first` right by `second` bits, wrapping around at the boundary of the ty *** -### `square` +### `sqrt` [Back to Top](#table-of-standard-opcodes) #### Description -Squares the input, storing the outcome in `destination`. +Computes the square root of the input, storing the outcome in `destination`. #### Supported Types @@ -1787,13 +1787,13 @@ Squares the input, storing the outcome in `destination`. *** -### `sqrt` +### `square` [Back to Top](#table-of-standard-opcodes) #### Description -Computes the square root of the input, storing the outcome in `destination`. +Squares the input, storing the outcome in `destination`. #### Supported Types @@ -1803,7 +1803,6 @@ Computes the square root of the input, storing the outcome in `destination`. *** - ### `sub` [Back to Top](#table-of-standard-opcodes) diff --git a/documentation/leo/04_operators.md b/documentation/leo/04_operators.md index a2b701deb..2c2545f34 100644 --- a/documentation/leo/04_operators.md +++ b/documentation/leo/04_operators.md @@ -1878,7 +1878,7 @@ let result: u128 = Keccak384::hash_to_u128(1field); #### Description -Computes a Keccak384 hash on inputs of 256-bit chunks in `first`, storing the hash in `destination`. +Computes a Keccak384 hash on inputs of 384-bit chunks in `first`, storing the hash in `destination`. The produced hash will always be an arithmetic (`u8`, `u16`, `u32`, `u64`, `u128`, `i8`, `i16`, `i32`,`i64`,`i128`, `field`, `group`, or `scalar`) or `address` value, as specified via `hash_to_DESTINATION` at the end of the function. #### Supported Types @@ -1886,7 +1886,7 @@ The produced hash will always be an arithmetic (`u8`, `u16`, `u32`, `u64`, `u128 | First | Destination | |-----------|:----------------------------------------------------------------------------------------------------------| | `address` | `address`, `field`, `group`, `scalar`, `i8`, `i16`, `i32`,`i64`,`i128`, `u8`, `u16`, `u32`, `u64`, `u128` | -| `bool` | `address`, `field`, `group`, `scalar`, `i8`, `i16`, `i32`,`i64`,`i128`, `u8`, `u16`, `u32`, `u64`, `u128` | +| `bool` | `address`, `field`, `group`, `scalar`, `i8`, `i16`, `i32`,`i64`,`i128`, `u8`, `u16`, `u32`, `u64`, `u128` | | `field` | `address`, `field`, `group`, `scalar`, `i8`, `i16`, `i32`,`i64`,`i128`, `u8`, `u16`, `u32`, `u64`, `u128` | | `group` | `address`, `field`, `group`, `scalar`, `i8`, `i16`, `i32`,`i64`,`i128`, `u8`, `u16`, `u32`, `u64`, `u128` | | `i8` | `address`, `field`, `group`, `scalar`, `i8`, `i16`, `i32`,`i64`,`i128`, `u8`, `u16`, `u32`, `u64`, `u128` | @@ -1926,7 +1926,7 @@ let result: u128 = Keccak512::hash_to_u128(1field); #### Description -Computes a Keccak512 hash on inputs of 256-bit chunks in `first`, storing the hash in `destination`. +Computes a Keccak512 hash on inputs of 512-bit chunks in `first`, storing the hash in `destination`. The produced hash will always be an arithmetic (`u8`, `u16`, `u32`, `u64`, `u128`, `i8`, `i16`, `i32`,`i64`,`i128`, `field`, `group`, or `scalar`) or `address` value, as specified via `hash_to_DESTINATION` at the end of the function. #### Supported Types