A quadratic diophantine equation solver