diff --git a/mindspore/lite/java/java/fl_client/src/main/java/com/mindspore/flclient/CipherClient.java b/mindspore/lite/java/java/fl_client/src/main/java/com/mindspore/flclient/CipherClient.java index 85146e320ae..14f8caf2792 100644 --- a/mindspore/lite/java/java/fl_client/src/main/java/com/mindspore/flclient/CipherClient.java +++ b/mindspore/lite/java/java/fl_client/src/main/java/com/mindspore/flclient/CipherClient.java @@ -449,8 +449,17 @@ public class CipherClient { String dateTime = String.valueOf(timestamp); int time = fbBuilder.createString(dateTime); - int exchangeKeysRoot = RequestExchangeKeys.createRequestExchangeKeys(fbBuilder, id, cpk, spk, iteration, time - , indIvFbs, pwIvFbs, pwSaltFbs); + // start build + RequestExchangeKeys.startRequestExchangeKeys(fbBuilder); + RequestExchangeKeys.addFlId(fbBuilder, id); + RequestExchangeKeys.addCPk(fbBuilder, cpk); + RequestExchangeKeys.addSPk(fbBuilder, spk); + RequestExchangeKeys.addIteration(fbBuilder, iteration); + RequestExchangeKeys.addTimestamp(fbBuilder, time); + RequestExchangeKeys.addIndIv(fbBuilder, indIvFbs); + RequestExchangeKeys.addPwIv(fbBuilder, pwIvFbs); + RequestExchangeKeys.addPwSalt(fbBuilder, pwSaltFbs); + int exchangeKeysRoot = RequestExchangeKeys.endRequestExchangeKeys(fbBuilder); fbBuilder.finish(exchangeKeysRoot); byte[] msg = fbBuilder.sizedByteArray(); String url = Common.generateUrl(flParameter.isUseElb(), flParameter.getServerNum(), @@ -508,7 +517,13 @@ public class CipherClient { long timestamp = date.getTime(); String dateTime = String.valueOf(timestamp); int time = fbBuilder.createString(dateTime); - int getExchangeKeysRoot = GetExchangeKeys.createGetExchangeKeys(fbBuilder, id, iteration, time); + + // start build + GetExchangeKeys.startGetExchangeKeys(fbBuilder); + GetExchangeKeys.addFlId(fbBuilder, id); + GetExchangeKeys.addIteration(fbBuilder, iteration); + GetExchangeKeys.addTimestamp(fbBuilder, time); + int getExchangeKeysRoot = GetExchangeKeys.endGetExchangeKeys(fbBuilder); fbBuilder.finish(getExchangeKeysRoot); byte[] msg = fbBuilder.sizedByteArray(); String url = Common.generateUrl(flParameter.isUseElb(), flParameter.getServerNum(), @@ -626,8 +641,14 @@ public class CipherClient { add[i] = clientShareRoot; } int encryptedSharesFbs = RequestShareSecrets.createEncryptedSharesVector(fbBuilder, add); - int requestShareSecretsRoot = RequestShareSecrets.createRequestShareSecrets(fbBuilder, id, - encryptedSharesFbs, iteration, time); + + // start build + RequestShareSecrets.startRequestShareSecrets(fbBuilder); + RequestShareSecrets.addFlId(fbBuilder, id); + RequestShareSecrets.addEncryptedShares(fbBuilder, encryptedSharesFbs); + RequestShareSecrets.addIteration(fbBuilder, iteration); + RequestShareSecrets.addTimestamp(fbBuilder, time); + int requestShareSecretsRoot = RequestShareSecrets.endRequestShareSecrets(fbBuilder); fbBuilder.finish(requestShareSecretsRoot); byte[] msg = fbBuilder.sizedByteArray(); String url = Common.generateUrl(flParameter.isUseElb(), flParameter.getServerNum(), @@ -686,7 +707,12 @@ public class CipherClient { long timestamp = date.getTime(); String dateTime = String.valueOf(timestamp); int time = fbBuilder.createString(dateTime); - int getShareSecrets = GetShareSecrets.createGetShareSecrets(fbBuilder, id, iteration, time); + + GetShareSecrets.startGetShareSecrets(fbBuilder); + GetShareSecrets.addFlId(fbBuilder, id); + GetShareSecrets.addIteration(fbBuilder, iteration); + GetShareSecrets.addTimestamp(fbBuilder, time); + int getShareSecrets = GetShareSecrets.endGetShareSecrets(fbBuilder); fbBuilder.finish(getShareSecrets); byte[] msg = fbBuilder.sizedByteArray(); String url = Common.generateUrl(flParameter.isUseElb(), flParameter.getServerNum(), diff --git a/mindspore/lite/java/java/fl_client/src/main/java/com/mindspore/flclient/GetModel.java b/mindspore/lite/java/java/fl_client/src/main/java/com/mindspore/flclient/GetModel.java index 8cb7b5851d3..495abadf14e 100644 --- a/mindspore/lite/java/java/fl_client/src/main/java/com/mindspore/flclient/GetModel.java +++ b/mindspore/lite/java/java/fl_client/src/main/java/com/mindspore/flclient/GetModel.java @@ -260,7 +260,11 @@ public class GetModel { } private byte[] build() { - int root = RequestGetModel.createRequestGetModel(this.builder, nameOffset, iteration, timeStampOffset); + RequestGetModel.startRequestGetModel(builder); + RequestGetModel.addFlName(builder, nameOffset); + RequestGetModel.addIteration(builder, iteration); + RequestGetModel.addTimestamp(builder, timeStampOffset); + int root = RequestGetModel.endRequestGetModel(builder); builder.finish(root); return builder.sizedByteArray(); } diff --git a/mindspore/lite/java/java/fl_client/src/main/java/com/mindspore/flclient/StartFLJob.java b/mindspore/lite/java/java/fl_client/src/main/java/com/mindspore/flclient/StartFLJob.java index bd600ffd84a..1333d7def24 100644 --- a/mindspore/lite/java/java/fl_client/src/main/java/com/mindspore/flclient/StartFLJob.java +++ b/mindspore/lite/java/java/fl_client/src/main/java/com/mindspore/flclient/StartFLJob.java @@ -141,8 +141,13 @@ public class StartFLJob { * @return byte[] data */ public byte[] build() { - int root = RequestFLJob.createRequestFLJob(this.builder, this.nameOffset, this.idOffset, this.iteration, - this.dataSize, this.timestampOffset); + RequestFLJob.startRequestFLJob(this.builder); + RequestFLJob.addFlName(builder, nameOffset); + RequestFLJob.addFlId(builder, idOffset); + RequestFLJob.addIteration(builder, iteration); + RequestFLJob.addDataSize(builder, dataSize); + RequestFLJob.addTimestamp(builder, timestampOffset); + int root = RequestFLJob.endRequestFLJob(builder); builder.finish(root); return builder.sizedByteArray(); } diff --git a/mindspore/lite/java/java/fl_client/src/main/java/com/mindspore/flclient/cipher/ClientListReq.java b/mindspore/lite/java/java/fl_client/src/main/java/com/mindspore/flclient/cipher/ClientListReq.java index 4d318c6d5b7..f4b9b9b3c8f 100644 --- a/mindspore/lite/java/java/fl_client/src/main/java/com/mindspore/flclient/cipher/ClientListReq.java +++ b/mindspore/lite/java/java/fl_client/src/main/java/com/mindspore/flclient/cipher/ClientListReq.java @@ -91,7 +91,12 @@ public class ClientListReq { long timestamp = date.getTime(); String dateTime = String.valueOf(timestamp); int time = builder.createString(dateTime); - int clientListRoot = GetClientList.createGetClientList(builder, id, iteration, time); + + GetClientList.startGetClientList(builder); + GetClientList.addFlId(builder, id); + GetClientList.addIteration(builder, iteration); + GetClientList.addTimestamp(builder, time); + int clientListRoot = GetClientList.endGetClientList(builder); builder.finish(clientListRoot); byte[] msg = builder.sizedByteArray(); String url = Common.generateUrl(flParameter.isUseElb(), flParameter.getServerNum(), flParameter.getDomainName()); diff --git a/mindspore/lite/java/java/fl_client/src/main/java/com/mindspore/flclient/cipher/ReconstructSecretReq.java b/mindspore/lite/java/java/fl_client/src/main/java/com/mindspore/flclient/cipher/ReconstructSecretReq.java index 8b7e750f101..2cdfb63d0c6 100644 --- a/mindspore/lite/java/java/fl_client/src/main/java/com/mindspore/flclient/cipher/ReconstructSecretReq.java +++ b/mindspore/lite/java/java/fl_client/src/main/java/com/mindspore/flclient/cipher/ReconstructSecretReq.java @@ -106,8 +106,12 @@ public class ReconstructSecretReq { } int reconstructShareSecrets = SendReconstructSecret.createReconstructSecretSharesVector(builder, decryptShareList); - int reconstructSecretRoot = SendReconstructSecret.createSendReconstructSecret(builder, desFlId, - reconstructShareSecrets, iteration, time); + SendReconstructSecret.startSendReconstructSecret(builder); + SendReconstructSecret.addFlId(builder, desFlId); + SendReconstructSecret.addReconstructSecretShares(builder, reconstructShareSecrets); + SendReconstructSecret.addIteration(builder, iteration); + SendReconstructSecret.addTimestamp(builder, time); + int reconstructSecretRoot = SendReconstructSecret.endSendReconstructSecret(builder); builder.finish(reconstructSecretRoot); byte[] msg = builder.sizedByteArray(); try {