diff --git a/documentation/aleo/03_language.md b/documentation/aleo/03_language.md index 45baac8ae7..b6118902dd 100644 --- a/documentation/aleo/03_language.md +++ b/documentation/aleo/03_language.md @@ -42,18 +42,23 @@ Higher bit length integers generate more constraints in the circuit, which can s ### Field Elements -Aleo instructions supports the `field` type for the base field elements of the elliptic curve. -These are unsigned integers below the modulus of the base field. +Aleo instructions supports the `field` type for elements of the base field of the elliptic curve. +These are unsigned integers less than the modulus of the base field, so the largest field element +is `8444461749428370424248824938781546531375899335154063827935233455917409239040field`. + ```aleo function main: input r0: field.private; ``` ### Group Elements + The set of affine points on the elliptic curve passed into the Aleo instructions compiler forms a group. -Leo supports a subgroup of this group, generated by a generator point, as a primitive data type. -Group elements are special since their values can be defined from the x-coordinate of a coordinate pair, such as -`0group`. The group type keyword `group` must be used when specifying a group value. +The curve is a Twisted Edwards curve with `a = -1` and `d = 3021`. +Aleo instructions supports a subgroup of the group, generated by a generator point, as a primitive data type. +A group element is denoted by the x-coordinate of its point; for example, +`2group` means the point `(2, 5553594316923449299484601589326170487897520766531075014687114064346375156608)`. +The generator point is `1540945439182663264862696551825005342995406165131907382295858612069623286213group`. ```aleo function main: @@ -61,8 +66,11 @@ function main: ``` ### Scalar Elements -Aleo instructions supports the `scalar` type for scalar field elements of the elliptic curve subgroup. -These are unsigned integers below the modulus of the scalar field. + +Aleo instructions supports the `scalar` type for elements of the scalar field defined by the elliptic curve subgroup. +These are unsigned integers less than the modulus of the scalar field, so the largest scalar is +`2111115437357092606062206234695386632838870926408408195193685246394721360382scalar`. + ```aleo function main: input r0: scalar.private; diff --git a/documentation/leo/03_language.md b/documentation/leo/03_language.md index 6cf8cefd31..a051f5922c 100644 --- a/documentation/leo/03_language.md +++ b/documentation/leo/03_language.md @@ -57,23 +57,26 @@ let b: u8 = 2; // implicit type -- not supported ### Field Elements -Leo supports the `field` type for the base field elements of the elliptic curve. -These are unsigned integers below the modulus of the base field. +Leo supports the `field` type for elements of the base field of the elliptic curve. +These are unsigned integers less than the modulus of the base field. The following are the +smallest and largest field elements. ```leo -let a: field = 1field; -let b: field = 21888242871839275222246405745257275088548364400416034343698204186575808495617field; +let a: field = 0field; +let b: field = 8444461749428370424248824938781546531375899335154063827935233455917409239040field; ``` ### Group Elements -The set of affine points on the elliptic curve passed into the Leo compiler forms a group. -Leo supports a subgroup of this group, generated by a generator point, as a primitive data type. -Group elements are special since their values can be defined from the x-coordinate of a coordinate pair, such as -`0group`. The group type keyword `group` must be used when specifying a group value. +The set of affine points on the elliptic curve forms a group. +The curve is a Twisted Edwards curve with `a = -1` and `d = 3021`. +Leo supports a subgroup of the group, generated by a generator point, as a primitive data type. +A group element is denoted by the x-coordinate of its point; for example, +`2group` means the point `(2, 5553594316923449299484601589326170487897520766531075014687114064346375156608)`. ```leo -let b: group = 0group; // the point with 0 x-coordinate +let a: group = 0group; // the point with 0 x-coordinate, (0, 1) +let b: group = 1540945439182663264862696551825005342995406165131907382295858612069623286213group; // the generator point ``` The aforementioned generator point can be obtained via a constant associated to the `group` type. @@ -84,11 +87,13 @@ let g: group = group::GEN; // the group generator ### Scalar Elements -Leo supports the `scalar` type for scalar field elements of the elliptic curve subgroup. -These are unsigned integers below the modulus of the scalar field. +Leo supports the `scalar` type for elements of the scalar field defined by the elliptic curve subgroup. +These are unsigned integers less than the modulus of the scalar field. Showing the smallest and largest +scalars. ```leo -let a: scalar = 1scalar; +let a: scalar = 0scalar; +let b: scalar = 2111115437357092606062206234695386632838870926408408195193685246394721360382scalar; ``` ### Addresses