pub struct Signature {
pub R: ProjectivePoint,
pub s: Scalar,
}Expand description
Ed25519 signature representation.
Signature verification libraries are expected to reject invalid field elements at the time a signature is verified.
Fields§
§R: ProjectivePointR is an EdwardsPoint, formed by using an hash function with
512-bits output to produce the digest of:
- the nonce half of the
ExpandedSecretKey, and - the message to be signed.
This digest is then interpreted as a Scalar and reduced into an
element in ℤ/lℤ. The scalar is then multiplied by the distinguished
basepoint to produce R, and EdwardsPoint.
s: Scalars is a Scalar, formed by using a hash function with 512-bits
output to produce the digest of:
- the
rportion of thisSignature, - the
PublicKeywhich should be used to verify thisSignature, and - the message to be signed.
This digest is then interpreted as a Scalar and reduced into an
element in ℤ/lℤ.
Implementations§
Source§impl Signature
impl Signature
Sourcepub fn to_bytes(&self) -> [u8; 64]
pub fn to_bytes(&self) -> [u8; 64]
Converts the signature to a 64-byte array.
The first 32 bytes contain the compressed encoding of the R value.
The last 32 bytes contain the canonical encoding of the s scalar.
Sourcepub fn from_affine_R_s(R: AffinePoint, s: Scalar) -> Self
pub fn from_affine_R_s(R: AffinePoint, s: Scalar) -> Self
Construct a signature from affine point R and scalar s.