INNER CODE UNIT · Python

target

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

	target = vector([(lb[i] + ub[i]) // 2 for i in range(num_ineq)])
	result = Babai_CVP(mat, target)

	for i in range(num_ineq):
		if (lb[i] <= result[i] <= ub[i]) == False:
			print("Fail : inequality does not hold after solving")
			break
    
    	# recover x
	fin = None

	if DET != 0:
		mat = mat.transpose()
		fin = mat.solve_right(result)
	
	## recover your result
	return result, applied_weights, fin

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…