syntax = "proto3";

package meerkat;

option java_package = "meerkat.protobuf";

message Payload {
    enum Type {
        SHARE = 0;
        COMMITMENT = 1;
        COMPLAINT = 2;
        DONE = 3;
        ANSWER = 4;
        YCOMMITMENT = 5;
        YCOMPLAINT = 6;
        YANSWER = 7;
        ABORT = 8;
    }


    // Type of message in protocol
    Type type = 1;

    oneof payload_data {
        IDMessage id = 5;
        ShareMessage share = 6;
        CommitmentMessage commitment = 7;
    }
}

message IDMessage {
    int32 id = 1;
}

message ShareMessage {
    int32 i = 1;
    int32 j = 2;
    bytes share = 3;
    // For double shares (used in GJKR protocol)
    bytes share_t = 4;
}

message CommitmentMessage {
    int32 k = 1;
    bytes commitment = 2;
}
