def METHOD_NAME(public, sl, sh, d, p, q):
    Ax = kpoint_decomp(public, d, p, q)
    Axn = Expr(func='sub_modp', args=(p, Ax, p))
    Ay = public & ((1 << 255) - 1)
    At = Expr(func='mul_modp', args=(Axn, Ay, p))
    A = (Axn, Ay, 1, At)
    Rx = kpoint_decomp(sl, d, p, q)
    T = kpoint_add(A, G, d, p)
    # checks
    r = 1
    r = ternary(sh >= q, 0, r)
    r = ternary(Ax == p, 0, r)
    r = ternary(Rx == p, 0, r)
    return r, Axn, At, Rx, T[0], T[1], T[2], T[3]