def _encode_asn1_int(backend, x):
 i = backend._int_to_bn(x)
 i = backend._ffi.gc(i, backend._lib.BN_free)
 i = backend._lib.BN_to_ASN1_INTEGER(i, backend._ffi.NULL)
 backend.openssl_assert((i != backend._ffi.NULL))
 return i

def _encode_asn1_int ( backend , x ) : i = backend . _int_to_bn ( x ) i = backend . _ffi . gc ( i , backend . _lib . BN_free ) i = backend . _lib . BN_to_ASN1_INTEGER ( i , backend . _ffi . NULL ) backend . openssl_assert ( ( i != backend . _ffi . NULL ) ) return i
converts a python integer to an asn1_integer .