diff --git a/src/ecdsa/serialized_signature.rs b/src/ecdsa/serialized_signature.rs index bfd035f..8cf2c02 100644 --- a/src/ecdsa/serialized_signature.rs +++ b/src/ecdsa/serialized_signature.rs @@ -53,6 +53,28 @@ impl PartialEq for [u8] { fn eq(&self, other: &SerializedSignature) -> bool { *self == **other } } +impl PartialOrd for SerializedSignature { + fn partial_cmp(&self, other: &SerializedSignature) -> Option { + Some((**self).cmp(&**other)) + } +} + +impl Ord for SerializedSignature { + fn cmp(&self, other: &SerializedSignature) -> core::cmp::Ordering { (**self).cmp(&**other) } +} + +impl PartialOrd<[u8]> for SerializedSignature { + fn partial_cmp(&self, other: &[u8]) -> Option { + (**self).partial_cmp(other) + } +} + +impl PartialOrd for [u8] { + fn partial_cmp(&self, other: &SerializedSignature) -> Option { + self.partial_cmp(&**other) + } +} + impl core::hash::Hash for SerializedSignature { fn hash(&self, state: &mut H) { (**self).hash(state) } }