An Improved Protocol for Demonstrating Possession of Discrete Logarithms and Some Generalizations