Quadratic memory reductions for Zero-knowledge Proofs