View Source ecies_pubkey (ecies v1.1.0)

This module contains functions for compressing, decompressing public key, deriving public key from the given private one and function for EC point multiplication.

Summary

Functions

Compresses the PublicKey, which is a binary representation of an elliptic curve point. Returns the PublicKey unchanged if it is already in compressed form.

Decompresses the PublicKey, which is a binary representation of an elliptic curve point.

Calculates a public key from the given PrivateKey.

Calculates the multiplication of an elliptic curve point given by PublicKey by a scalar given by PrivateKey.

Returns the number of bits required for the binary representation of a single coordinate of a point on a given elliptic curve.
Returns a list of named curves that are supported by the decompress/1 and decompress/2 functions.
Checks if the given NamedCurve is supported by the decompress/1 and decompress/2 functions.
Returns a list of named curves that are supported by the from_private/1 and from_private/2 functions.
Checks if the given NamedCurve is supported by the from_private/1 and from_private/2 functions.

Functions

-spec compress(ecies:public_key()) -> ecies:public_key().

Equivalent to compress(PubKey, ecies:default_params()).

Compresses the PublicKey, which is a binary representation of an elliptic curve point. Returns the PublicKey unchanged if it is already in compressed form.
Link to this function

compress(PubKey, Params)

View Source
Compresses the PublicKey, which is a binary representation of an elliptic curve point. Returns the PublicKey unchanged if it is already in compressed form.
-spec decompress(PublicKey :: ecies:public_key()) -> ecies:public_key().

Equivalent to decompress(PublicKey, ecies:default_params()).

Decompresses the PublicKey, which is a binary representation of an elliptic curve point.

If the PublicKey is already in decompressed form, it returns the PublicKey unchanged.
Link to this function

decompress(PublicKey, _)

View Source
-spec decompress(PublicKey :: ecies:public_key(), ecies:ecies_params()) -> ecies:public_key().

Decompresses the PublicKey, which is a binary representation of an elliptic curve point.

If the PublicKey is already in decompressed form, it returns the PublicKey unchanged. This function is only valid for curves returned by the supports_decompress/0 function.

See also: supports_decompress/0, supports_decompress/1.

Link to this function

from_private(PrivateKey)

View Source
-spec from_private(PrivateKey :: ecies:private_key()) -> ecies:public_key().

Equivalent to from_private(PrivateKey, ecies:default_params()).

Calculates a public key from the given PrivateKey.
Link to this function

from_private(PrivateKey, Params)

View Source
-spec from_private(PrivateKey :: ecies:private_key(), ecies:ecies_params()) -> ecies:public_key().

Calculates a public key from the given PrivateKey.

This function is only valid for curves returned by supports_from_private/0.

See also: supports_from_private/0, supports_from_private/1.

Link to this function

mul(PublicKey, PrivateKey)

View Source
-spec mul(PublicKey :: ecies:public_key(), PrivateKey :: ecies:private_key()) -> ecies:public_key().

Equivalent to mul(PublicKey, PrivateKey, ecies:default_params()).

Calculates the multiplication of an elliptic curve point given by PublicKey by a scalar given by PrivateKey.
Link to this function

mul(PublicKey, PrivateKey, Params)

View Source

Calculates the multiplication of an elliptic curve point given by PublicKey by a scalar given by PrivateKey.

This function is only valid for curves returned by supports_decompress/0.

See also: supports_decompress/0, supports_decompress/1.

-spec point_bits(ecies:named_curve()) -> integer().
Returns the number of bits required for the binary representation of a single coordinate of a point on a given elliptic curve.
-spec supports_decompress() -> [ecies:named_curve()].
Returns a list of named curves that are supported by the decompress/1 and decompress/2 functions.
Link to this function

supports_decompress(NamedCurve)

View Source
-spec supports_decompress(NamedCurve :: ecies:named_curve()) -> boolean().
Checks if the given NamedCurve is supported by the decompress/1 and decompress/2 functions.
-spec supports_from_private() -> [ecies:named_curve()].
Returns a list of named curves that are supported by the from_private/1 and from_private/2 functions.
Link to this function

supports_from_private(NamedCurve)

View Source
-spec supports_from_private(NamedCurve :: ecies:named_curve()) -> boolean().
Checks if the given NamedCurve is supported by the from_private/1 and from_private/2 functions.