Struct diem_sdk::crypto::ed25519::Ed25519Signature[][src]

pub struct Ed25519Signature(_);
Expand description

An Ed25519 signature

Implementations

The length of the Ed25519Signature

Serialize an Ed25519Signature.

Check for correct size and third-party based signature malleability issues. This method is required to ensure that given a valid signature for some message under some key, an attacker cannot produce another valid signature for the same message and key.

According to RFC8032, signatures comprise elements {R, S} and we should enforce that S is of canonical form (smaller than L, where L is the order of edwards25519 curve group) to prevent signature malleability. Without this check, one could add a multiple of L into S and still pass signature verification, resulting in a distinct yet valid signature.

This method does not check the R component of the signature, because R is hashed during signing and verification to compute h = H(ENC(R) || ENC(A) || M), which means that a third-party cannot modify R without being detected.

Note: It’s true that malicious signers can already produce varying signatures by choosing a different nonce, so this method protects against malleability attacks performed by a non-signer.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

Formats the value using the given formatter. Read more

Performs the conversion.

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

The serialized length of the data

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Verifies that the provided signature is valid for the provided message, according to the RFC8032 algorithm. This strict verification performs the recommended check of 5.1.7 §3, on top of the required RFC8032 verifications.

Checks that self is valid for an arbitrary &u8 message using public_key. Outside of this crate, this particular function should only be used for native signature verification in move

The associated verifying key type for this signature.

The associated signing key type for this signature

Convert the signature into a byte representation.

The implementer can override a batch verification implementation that by default iterates over each signature. More efficient implementations exist and should be implemented for many schemes. Read more

The type returned in the event of a conversion error.

Performs the conversion.

Convert the valid crypto material to bytes.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Compare self to key and return true if they are equal.

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Should always be Self

Generates a hash used only for tests.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

When trying to convert from bytes, we simply decode the string into bytes before checking if we can convert. Read more

A function to encode into hex-string after serializing.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more