ed25519_utils

Module for ed25519 utility functions.

class Ed25519Utils

Bases: object

Class container for ed25519 utility functions.

static IntDecode(int_bytes: bytes) int

Decode int from bytes.

Parameters:

int_bytes (bytes) – Integer bytes

Returns:

Decoded integer

Return type:

int

static IntEncode(int_val: int) bytes

Encode int to bytes.

Parameters:

int_val (int) – Integer value

Returns:

Encoded integer

Return type:

bytes

static ScalarReduce(scalar: Union[bytes, int]) bytes

Convert the specified bytes to integer and return its lowest 32-bytes modulo ed25519-order.

Parameters:

scalar (bytes or int) – Scalar

Returns:

Lowest 32-bytes modulo ed25519-order

Return type:

bytes