recover_public_key

Recovers the public key associated with a given signature and message hash.Returns the public key as a point on the curve. # Examples

use starknet::secp256r1::Secp256r1Point;
use starknet::secp256_trait::{Signature, recover_public_key};

let msg_hash = 0x4cee90eb86eaa050036147a12d49004b6b9c72bd725d39d4785011fe190f0b4d;

let signature = Signature {
    r: 0xa73bd4903f0ce3b639bbbf6e8e80d16931ff4bcf5993d58468e8fb19086e8cac,
    s: 0x36dbcd03009df8c59286b162af3bd7fcc0450c9aa81be5d10d312af6c66b1d60,
    y_parity: true,
};

let public_key = recover_public_key::<Secp256r1Point>(msg_hash, signature);

Fully qualified path: core::starknet::secp256_trait::recover_public_key

pub fn recover_public_key<
    Secp256Point,
    +Drop<Secp256Point>,
    impl Secp256Impl: Secp256Trait<Secp256Point>,
    +Secp256PointTrait<Secp256Point>,
>(
    msg_hash: u256, signature: Signature,
) -> Option<Secp256Point>