pub unsafe fn secp256k1_ec_pubkey_parse(
        cx: *const Context,
        pk: *mut PublicKey,
        input: *const c_uchar,
        in_len: size_t,
    ) -> c_int {
        assert!(
            !cx.is_null()
                && (*cx).0 as u32
                    & !(SECP256K1_START_NONE | SECP256K1_START_VERIFY | SECP256K1_START_SIGN)
                    == 0
        );
        match in_len {
            33 => {
                if (*input.offset(1) > 0x7f && *input != 2)
                    || (*input.offset(1) <= 0x7f && *input != 3)
                {
                    0
                } else {
                    ptr::copy(input.offset(1), (*pk).0[0..32].as_mut_ptr(), 32);
                    ptr::copy(input.offset(1), (*pk).0[32..64].as_mut_ptr(), 32);
                    test_pk_validate(cx, pk)
                }
            }
            65 => {
                if *input != 4 && *input != 6 && *input != 7 {
                    0
                } else {
                    ptr::copy(input.offset(1), (*pk).0.as_mut_ptr(), 64);
                    test_pk_validate(cx, pk)
                }
            }
            _ => 0,
        }
    }
// Pubkeys
/// Parse 33/65 byte pubkey into PublicKey, losing compressed information
Pubkeys
Parse 33/65 byte pubkey into PublicKey, losing compressed information
Pubkeys Parse 33 / 65 byte pubkey into PublicKey losing compressed information
pub unsafe fn secp256k1_ec_pubkey_parse(
        cx: *const Context,
        pk: *mut PublicKey,
        input: *const c_uchar,
        in_len: size_t,
    ) -> c_int {
        assert!(
            !cx.is_null()
                && (*cx).0 as u32
                    & !(SECP256K1_START_NONE | SECP256K1_START_VERIFY | SECP256K1_START_SIGN)
                    == 0
        );
        match in_len {
            33 => {
                if (*input.offset(1) > 0x7f && *input != 2)
                    || (*input.offset(1) <= 0x7f && *input != 3)
                {
                    0
                } else {
                    ptr::copy(input.offset(1), (*pk).0[0..32].as_mut_ptr(), 32);
                    ptr::copy(input.offset(1), (*pk).0[32..64].as_mut_ptr(), 32);
                    test_pk_validate(cx, pk)
                }
            }
            65 => {
                if *input != 4 && *input != 6 && *input != 7 {
                    0
                } else {
                    ptr::copy(input.offset(1), (*pk).0.as_mut_ptr(), 64);
                    test_pk_validate(cx, pk)
                }
            }
            _ => 0,
        }
    }
pub unsafe fn secp256k1_ec_pubkey_parse ( cx : * const Context , pk : * mut PublicKey , input : * const c_uchar , in_len : size_t , ) -> c_int { assert ! ( cx is_null ( ) ( cx ) 0 as u32 ( SECP256K1_START_NONE SECP256K1_START_VERIFY SECP256K1_START_SIGN ) 0 ) ; match in_len { 33 => { if ( * input . offset ( 1 ) > 0x7f && * input != 2 ) || ( * input . offset ( 1 ) <= 0x7f && * input != 3 ) { 0 } else { ptr :: copy ( input . offset ( 1 ) , ( * pk ) . 0 [ 0 .. 32 ] . as_mut_ptr ( ) , 32 ) ; ptr :: copy ( input . offset ( 1 ) , ( * pk ) . 0 [ 32 .. 64 ] . as_mut_ptr ( ) , 32 ) ; test_pk_validate ( cx , pk ) } } 65 => { if * input != 4 && * input != 6 && * input != 7 { 0 } else { ptr :: copy ( input . offset ( 1 ) , ( * pk ) . 0 . as_mut_ptr ( ) , 64 ) ; test_pk_validate ( cx , pk ) } } _ => 0 , } }
Pubkeys
Parse 33/65 byte pubkey into PublicKey, losing compressed information
Pubkeys Parse 33 / 65 byte pubkey into PublicKey losing compressed information
cx
*const Context
pk
*mut PublicKey
input
*const c_uchar
in_len
size_t
cx
*const Context
pk
*mut PublicKey
input
*const c_uchar
in_len
size_t