Added threshold capability, implemented encryptions and proofs