/**
 * Copyright 2021 Huawei Technologies Co., Ltd
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

namespace mindspore.schema;

table CipherPublicParams {
  t:int;
  p:[ubyte];
  g:int;
  prime:[ubyte];
  dp_eps:float;
  dp_delta:float;
  dp_norm_clip:float;
  encrypt_type:string;
}

table ClientPublicKeys {
  fl_id:string;
  c_pk:[ubyte];
  s_pk: [ubyte];
  pw_iv: [ubyte];
  pw_salt: [ubyte];
}

table ClientShare {
  fl_id:string;
  share:[ubyte];
  index:int;
}

table RequestExchangeKeys{
  fl_id:string;
  c_pk:[ubyte];
  s_pk:[ubyte];
  iteration:int;
  timestamp:string;
  ind_iv:[ubyte];
  pw_iv:[ubyte];
  pw_salt:[ubyte];
}

table ResponseExchangeKeys{
  retcode:int;
  reason:string;
  next_req_time:string;
  iteration:int;
}

table GetExchangeKeys{
  fl_id:string;
  iteration:int;
  timestamp:string;
}

table ReturnExchangeKeys{
  retcode:int;
  iteration:int;
  remote_publickeys:[ClientPublicKeys];
  next_req_time:string;
}

table RequestShareSecrets{
  fl_id:string;
  encrypted_shares:[ClientShare];
  iteration:int;
  timestamp:string;
}

table ResponseShareSecrets{
  retcode:int;
  reason:string;
  next_req_time:string;
  iteration:int;
}

table GetShareSecrets{
  fl_id:string;
  iteration:int;
  timestamp:string;
}

table ReturnShareSecrets{
  retcode:int;
  iteration:int;
  encrypted_shares: [ClientShare];
  next_req_time:string;
}

table GetClientList{
  fl_id:string;
  iteration:int;
  timestamp:string;
}

table ReturnClientList{
  retcode:int;
  reason:string;
  clients:[string];
  iteration:int;
  next_req_time:string;
}

table SendReconstructSecret{
  fl_id:string;
  reconstruct_secret_shares:[ClientShare];
  iteration:int;
  timestamp:string;
}

table ReconstructSecret{
  retcode:int;
  reason:string;
  iteration:int;
  next_req_time:string;
}