sigma.serialization.ProveDHTupleSerializer.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sigma-state_2.12 Show documentation
Show all versions of sigma-state_2.12 Show documentation
Interpreter of a Sigma-State language
The newest version!
package sigma.serialization
import sigma.crypto.EcPointType
import sigma.data.ProveDHTuple
case class ProveDHTupleSerializer(
cons: (EcPointType, EcPointType, EcPointType, EcPointType) => ProveDHTuple
) extends CoreSerializer[ProveDHTuple, ProveDHTuple] {
override def serialize(obj: ProveDHTuple, w: CoreByteWriter): Unit = {
GroupElementSerializer.serialize(obj.gv, w)
GroupElementSerializer.serialize(obj.hv, w)
GroupElementSerializer.serialize(obj.uv, w)
GroupElementSerializer.serialize(obj.vv, w)
}
override def parse(r: CoreByteReader) = {
val gv = GroupElementSerializer.parse(r)
val hv = GroupElementSerializer.parse(r)
val uv = GroupElementSerializer.parse(r)
val vv = GroupElementSerializer.parse(r)
cons(gv, hv, uv, vv)
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy