<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def ecdsa_sign_compact(msg32, seckey):
 """ Takes the same message and seckey as _ecdsa_sign_recoverable Returns an unsigned char array of length 65 containing the signed message """

    # Assign 65 bytes to output
    output64 = ffi.new("unsigned char[65]")
    # ffi definition of recid
    recid = ffi.new("int *")

    lib.secp256k1_ecdsa_recoverable_signature_serialize_compact(
        ctx,
        output64,
        recid,
        _ecdsa_sign_recoverable(msg32, seckey)
    )

    # Assign recid to the last byte in the output array
    r = ffi.buffer(output64)[:64] + struct.pack("B", recid[0])
    assert len(r) == 65, len(r)
    return r