Update crypto to support DSA and refactor a bit.