Skip to content

Commit

Permalink
Remove superfluous Signature.[de]serialize method
Browse files Browse the repository at this point in the history
Those methods are only performing the default serialization,
so they can be safely removed.
  • Loading branch information
Geod24 committed Dec 3, 2019
1 parent 6e1d9d7 commit 300a59f
Showing 1 changed file with 3 additions and 33 deletions.
36 changes: 3 additions & 33 deletions source/agora/common/crypto/Schnorr.d
Expand Up @@ -49,9 +49,6 @@ import agora.common.Types;
import agora.common.Hash;
import agora.common.crypto.ECC;

import agora.common.Deserializer;
import agora.common.Serializer;

import std.algorithm;
import std.range;

Expand Down Expand Up @@ -99,41 +96,14 @@ public struct Signature
public Point R;
/// Proof
public Scalar s;

/***************************************************************************
Serialization
Params:
dg = serialize function accumulator
***************************************************************************/

public void serialize (scope SerializeDg dg) const @safe
{
serializePart(this.R, dg);
serializePart(this.s, dg);
}

/***************************************************************************
Deserialization
Params:
dg = deserialize function accumulator
***************************************************************************/

public void deserialize (scope DeserializeDg dg) @safe
{
deserializePart(this.R, dg);
deserializePart(this.s, dg);
}
}

///
unittest
{
import agora.common.Deserializer;
import agora.common.Serializer;

const KP = Pair.random();
auto signature = Signature(KP.V, KP.v);
auto bytes = signature.serializeFull();
Expand Down

0 comments on commit 300a59f

Please sign in to comment.