pub unsafe fn secp256k1_ec_pubkey_serialize(
        cx: *const Context,
        output: *mut c_uchar,
        out_len: *mut size_t,
        pk: *const PublicKey,
        compressed: c_uint,
    ) -> c_int {
        assert!(
            !cx.is_null()
                && (*cx).0 as u32
                    & !(SECP256K1_START_NONE | SECP256K1_START_VERIFY | SECP256K1_START_SIGN)
                    == 0
        );
        if test_pk_validate(cx, pk) != 1 {
            return 0;
        }
        if compressed == SECP256K1_SER_COMPRESSED {
            assert_eq!(*out_len, 33);
            if (*pk).0[0] > 0x7f {
                *output = 2;
            } else {
                *output = 3;
            }
            ptr::copy((*pk).0.as_ptr(), output.offset(1), 32);
        } else if compressed == SECP256K1_SER_UNCOMPRESSED {
            assert_eq!(*out_len, 65);
            *output = 4;
            ptr::copy((*pk).0.as_ptr(), output.offset(1), 64);
        } else {
            panic!("Bad flags");
        }
        1
    }
/// Serialize PublicKey back to 33/65 byte pubkey
Serialize PublicKey back to 33/65 byte pubkey
Serialize PublicKey back to 33 / 65 byte pubkey
pub unsafe fn secp256k1_ec_pubkey_serialize(
        cx: *const Context,
        output: *mut c_uchar,
        out_len: *mut size_t,
        pk: *const PublicKey,
        compressed: c_uint,
    ) -> c_int {
        assert!(
            !cx.is_null()
                && (*cx).0 as u32
                    & !(SECP256K1_START_NONE | SECP256K1_START_VERIFY | SECP256K1_START_SIGN)
                    == 0
        );
        if test_pk_validate(cx, pk) != 1 {
            return 0;
        }
        if compressed == SECP256K1_SER_COMPRESSED {
            assert_eq!(*out_len, 33);
            if (*pk).0[0] > 0x7f {
                *output = 2;
            } else {
                *output = 3;
            }
            ptr::copy((*pk).0.as_ptr(), output.offset(1), 32);
        } else if compressed == SECP256K1_SER_UNCOMPRESSED {
            assert_eq!(*out_len, 65);
            *output = 4;
            ptr::copy((*pk).0.as_ptr(), output.offset(1), 64);
        } else {
            panic!("Bad flags");
        }
        1
    }
pub unsafe fn secp256k1_ec_pubkey_serialize ( cx : * const Context , output : * mut c_uchar , out_len : * mut size_t , pk : * const PublicKey , compressed : c_uint , ) -> c_int { assert ! ( cx is_null ( ) ( cx ) 0 as u32 ( SECP256K1_START_NONE SECP256K1_START_VERIFY SECP256K1_START_SIGN ) 0 ) ; if test_pk_validate ( cx , pk ) != 1 { return 0 ; } if compressed == SECP256K1_SER_COMPRESSED { assert_eq ! ( out_len 33 ) ; if ( * pk ) . 0 [ 0 ] > 0x7f { * output = 2 ; } else { * output = 3 ; } ptr :: copy ( ( * pk ) . 0 . as_ptr ( ) , output . offset ( 1 ) , 32 ) ; } else if compressed == SECP256K1_SER_UNCOMPRESSED { assert_eq ! ( out_len 65 ) ; * output = 4 ; ptr :: copy ( ( * pk ) . 0 . as_ptr ( ) , output . offset ( 1 ) , 64 ) ; } else { panic ! ( " " ) ; } 1 }
Serialize PublicKey back to 33/65 byte pubkey
Serialize PublicKey back to 33 / 65 byte pubkey
cx
*const Context
output
*mut c_uchar
out_len
*mut size_t
pk
*const PublicKey
compressed
c_uint
cx
*const Context
output
*mut c_uchar
out_len
*mut size_t
pk
*const PublicKey
compressed
c_uint