NIST P-256 elliptic curve (secp256r1) for MoonBit: ECDSA and ECDH
Dependencies
pub struct AffinePoint {
x : FixedArray[UInt]
y : FixedArray[UInt]
infinity : Bool
}pub struct ProjectivePoint {
x : FixedArray[UInt]
y : FixedArray[UInt]
z : FixedArray[UInt]
}fn ecdh_bytes(private_key : Bytes, peer_public_key : Bytes) -> Result[Bytes, String]fn ecdsa_sign(private_key : Array[UInt], message_hash : FixedArray[UInt]) -> Result[ECDSASignature, String]fn ecdsa_sign_message(private_key : Array[UInt], message : Array[UInt]) -> Result[ECDSASignature, String]fn ecdsa_verify(public_key : Array[UInt], message_hash : FixedArray[UInt], signature : ECDSASignature) -> Result[Bool, String]fn ecdsa_verify_bytes(public_key : Bytes, message : Bytes, signature : ECDSASignature) -> Result[Bool, String]fn ecdsa_verify_message(public_key : Array[UInt], message : Array[UInt], signature : ECDSASignature) -> Result[Bool, String]NIST P-256 elliptic curve (secp256r1) for MoonBit: ECDSA and ECDH
Dependencies