INNER CODE UNIT · Python

u2

rkm0959/Inequality_Solving_with_CVP · Example Challenge 6 - GoogleCTF 2021 - H1/solve_challenge_6.py:140

	u2 = x2 * z1sqr % mod
	s1 = y1 * z2 * z2sqr % mod
	s2 = y2 * z1 * z1sqr % mod
	if u1 == u2:
		if s1 != s2:
			return INF
		else:
			return Double(p)
	h = u2 - u1 % mod
	hsqr = h * h % mod
	hcube = hsqr * h % mod
	r = s2 - s1 % mod
	t = u1 * hsqr % mod
	x3 = (r * r - hcube - 2 * t) % mod
	y3 = (r * (t - x3) - s1 * hcube) % mod
	z3 = h * z1 * z2 % mod
	return x3, y3, z3

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…