schnorr_pok 0.23.0

Schnorr, Okamoto, Chaum-Pedersen protocols for proof of knowledge, equality and inequality of one or more discrete logs. Working in elliptic curve and pairing groups
Documentation
// TODO: At some point this should be replaced with crates anyhow and thiserror but thiserror is no_std compatible at the moment.

use ark_serialize::SerializationError;
use ark_std::fmt::Debug;
use dock_crypto_utils::serde_utils::ArkSerializationError;
use serde::Serialize;

#[derive(Debug, Serialize)]
pub enum SchnorrError {
    ExpectedSameSizeSequences(usize, usize),
    IndexOutOfBounds(usize, usize),
    InvalidResponse,
    #[serde(with = "ArkSerializationError")]
    Serialization(SerializationError),
    ValueMustNotBeEqual,
    InvalidProofOfEquality,
    MissingBlindingAtIndex(usize),
    MissingResponseAtIndex(usize),
    FoundCommonIndexInOwnAndReceivedResponses(usize),
    NotAProduct,
    NotASquare,
    NotAnInverse,
}

impl From<SerializationError> for SchnorrError {
    fn from(e: SerializationError) -> Self {
        Self::Serialization(e)
    }
}