package core:crypto/ristretto255
Overview
package ristretto255 implement the ristretto255 prime-order group.
Index
Types (2)
Constants (4)
Variables (0)
This section is empty.
Procedures (32)
- ge_add
- ge_bytes
- ge_clear
- ge_cond_assign
- ge_cond_negate
- ge_cond_select
- ge_double
- ge_double_scalarmult_generator_vartime
- ge_equal
- ge_generator
- ge_identity
- ge_is_identity
- ge_negate
- ge_scalarmult
- ge_scalarmult_generator
- ge_scalarmult_vartime
- ge_set
- ge_set_bytes
- ge_set_wide_bytes
- sc_add
- sc_bytes
- sc_clear
- sc_cond_assign
- sc_equal
- sc_mul
- sc_negate
- sc_set
- sc_set_bytes
- sc_set_bytes_wide
- sc_set_u64
- sc_square
- sc_sub
Procedure Groups (0)
This section is empty.
Types
Group_Element ¶
Group_Element :: struct { // WARNING: While the internal representation is an Edwards25519 // group element, this is not guaranteed to always be the case, // and your code *WILL* break if you mess with `_p`. _p: _edwards25519.Group_Element, _is_initialized: bool, }
Group_Element is a ristretto255 group element. The zero-initialized value is invalid.
Related Procedures With Parameters
Scalar ¶
Scalar :: field_scalar25519.Montgomery_Domain_Field_Element
Scalar is a ristretto255 scalar. The zero-initialized value is valid,
and represents 0
.
Constants
ELEMENT_SIZE ¶
ELEMENT_SIZE :: 32
ELEMENT_SIZE is the size of a byte-encoded ristretto255 group element.
WIDE_ELEMENT_SIZE ¶
WIDE_ELEMENT_SIZE :: 64
WIDE_ELEMENT_SIZE is the side of a wide byte-encoded ristretto255 group element.
WIDE_SCALAR_SIZE ¶
WIDE_SCALAR_SIZE :: 64
WIDE_SCALAR_SIZE is the size of a wide byte-encoded ristretto255 scalar.
Variables
This section is empty.
Procedures
ge_bytes ¶
ge_bytes :: proc(ge: ^Group_Element, dst: []u8) {…}
ge_bytes sets dst to the canonical encoding of ge.
ge_clear ¶
ge_clear :: proc "contextless" (ge: ^Group_Element) {…}
ge_clear clears ge to the uninitialized state.
ge_cond_assign ¶
ge_cond_assign :: proc(ge, a: ^Group_Element, ctrl: int) {…}
ge_cond_assign sets ge = ge
iff ctrl == 0
and ge = a
iff ctrl == 1
.
Behavior for all other values of ctrl are undefined,
ge_cond_negate ¶
ge_cond_negate :: proc(ge, a: ^Group_Element, ctrl: int) {…}
ge_cond_negate sets ge = a
iff ctrl == 0
and ge = -a
iff ctrl == 1
.
Behavior for all other values of ctrl are undefined,
ge_cond_select ¶
ge_cond_select :: proc(ge, a, b: ^Group_Element, ctrl: int) {…}
ge_cond_select sets ge = a
iff ctrl == 0
and ge = b
iff ctrl == 1
.
Behavior for all other values of ctrl are undefined,
ge_double_scalarmult_generator_vartime ¶
ge_double_scalarmult_generator_vartime :: proc(ge: ^Group_Element, a: ^field_scalar25519.Montgomery_Domain_Field_Element, A: ^Group_Element, b: ^field_scalar25519.Montgomery_Domain_Field_Element) {…}
ge_double_scalarmult_generator_vartime sets ge = A * a + G * b
in variable
time.
ge_equal ¶
ge_equal :: proc(a, b: ^Group_Element) -> int {…}
ge_equal returns 1 iff a == b
, and 0 otherwise.
ge_generator ¶
ge_generator :: proc "contextless" (ge: ^Group_Element) {…}
ge_generator sets ge to the group generator.
ge_identity ¶
ge_identity :: proc "contextless" (ge: ^Group_Element) {…}
ge_identity sets ge to the identity (neutral) element.
ge_is_identity ¶
ge_is_identity :: proc(ge: ^Group_Element) -> int {…}
ge_is_identity returns 1 iff ge
is the identity element, and 0 otherwise.
ge_scalarmult ¶
ge_scalarmult :: proc(ge, A: ^Group_Element, sc: ^field_scalar25519.Montgomery_Domain_Field_Element) {…}
ge_scalarmult sets ge = A * sc
.
ge_scalarmult_generator ¶
ge_scalarmult_generator :: proc "contextless" (ge: ^Group_Element, sc: ^field_scalar25519.Montgomery_Domain_Field_Element) {…}
ge_scalarmult_generator sets ge = G * sc
ge_scalarmult_vartime ¶
ge_scalarmult_vartime :: proc(ge, A: ^Group_Element, sc: ^field_scalar25519.Montgomery_Domain_Field_Element) {…}
ge_scalarmult_vartime sets ge = A * sc
in variable time.
ge_set_bytes ¶
ge_set_bytes :: proc "contextless" (ge: ^Group_Element, b: []u8) -> bool {…}
ge_set_bytes sets ge to the result of decoding b as a ristretto255 group element, and returns true on success.
ge_set_wide_bytes ¶
ge_set_wide_bytes :: proc(ge: ^Group_Element, b: []u8) {…}
ge_set_wide_bytes sets ge to the result of deriving a ristretto255 group element, from a wide (512-bit) byte string.
sc_add ¶
sc_add :: proc "contextless" (sc, a, b: ^field_scalar25519.Montgomery_Domain_Field_Element) {…}
sc_add sets sc = a + b
.
sc_bytes ¶
sc_bytes :: proc(sc: ^field_scalar25519.Montgomery_Domain_Field_Element, dst: []u8) {…}
sc_bytes sets dst to the canonical encoding of sc.
sc_clear ¶
sc_clear :: proc "contextless" (sc: ^field_scalar25519.Montgomery_Domain_Field_Element) {…}
sc_clear clears sc to the uninitialized state.
sc_cond_assign ¶
sc_cond_assign :: proc(sc, a: ^field_scalar25519.Montgomery_Domain_Field_Element, ctrl: int) {…}
sc_cond_assign sets sc = sc
iff ctrl == 0
and sc = a
iff ctrl == 1
.
Behavior for all other values of ctrl are undefined,
sc_equal ¶
sc_equal :: proc(a, b: ^field_scalar25519.Montgomery_Domain_Field_Element) -> int {…}
sc_equal returns 1 iff a == b
, and 0 otherwise.
sc_mul ¶
sc_mul :: proc "contextless" (sc, a, b: ^field_scalar25519.Montgomery_Domain_Field_Element) {…}
sc_mul sets sc = a * b
.
sc_negate ¶
sc_negate :: proc "contextless" (sc, a: ^field_scalar25519.Montgomery_Domain_Field_Element) {…}
sc_negate sets sc = -a
.
sc_set ¶
sc_set :: proc "contextless" (sc, a: ^field_scalar25519.Montgomery_Domain_Field_Element) {…}
sc_set sets sc = a
.
sc_set_bytes ¶
sc_set_bytes :: proc(sc: ^field_scalar25519.Montgomery_Domain_Field_Element, b: []u8) -> bool {…}
sc_set_bytes sets sc to the result of decoding b as a ristretto255 scalar, and returns true on success.
sc_set_bytes_wide ¶
sc_set_bytes_wide :: proc(sc: ^field_scalar25519.Montgomery_Domain_Field_Element, b: []u8) {…}
sc_set_wide_bytes sets sc to the result of deriving a ristretto255 scalar, from a wide (512-bit) byte string by interpreting b as a little-endian value, and reducing it mod the group order.
sc_set_u64 ¶
sc_set_u64 :: proc "contextless" (sc: ^field_scalar25519.Montgomery_Domain_Field_Element, i: u64) {…}
sc_set_u64 sets sc = i
.
sc_square ¶
sc_square :: proc "contextless" (sc, a: ^field_scalar25519.Montgomery_Domain_Field_Element) {…}
sc_square sets sc = a^2
.
sc_sub ¶
sc_sub :: proc "contextless" (sc, a, b: ^field_scalar25519.Montgomery_Domain_Field_Element) {…}
sc_sub sets sc = a - b
.
Procedure Groups
This section is empty.
Source Files
Generation Information
Generated with odin version dev-2024-11 (vendor "odin") Windows_amd64 @ 2024-11-20 21:11:50.536013900 +0000 UTC