From a7be50024e5e5d6179b070be3d7cc35395e741c7 Mon Sep 17 00:00:00 2001 From: fanbo Date: Fri, 15 Oct 2021 05:41:24 -0700 Subject: [PATCH] fix:fix homohandler bugs --- build.gradle | 2 +- src/main/java/org/bdware/sc/ContractProcess.java | 14 +++++++------- .../sc/engine/hook/HomomorphicEncryptHandler.java | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/build.gradle b/build.gradle index 190d9fb..726c2ae 100644 --- a/build.gradle +++ b/build.gradle @@ -26,7 +26,7 @@ sourceSets { dependencies { implementation project(":common") - implementation project(":mockjava") + implementation project(":MockJava") implementation 'com.atlassian.commonmark:commonmark:0.17.0' implementation 'com.idealista:format-preserving-encryption:1.0.0' diff --git a/src/main/java/org/bdware/sc/ContractProcess.java b/src/main/java/org/bdware/sc/ContractProcess.java index 14457e4..f786a9e 100644 --- a/src/main/java/org/bdware/sc/ContractProcess.java +++ b/src/main/java/org/bdware/sc/ContractProcess.java @@ -548,13 +548,6 @@ public class ContractProcess { if (fun.isConfidential()) { fun.appendBeforeInvokeHandler(new ConfidentialHandler(fun)); } - if (fun.isHomomorphicEncrypt()) { - LOGGER.info("injectHandlers--------------------------------1"); - fun.appendAfterInvokeHandler(new HomomorphicEncryptHandler(fun)); - } - if (fun.isHomomorphicDecrypt()) { - fun.appendAfterInvokeHandler(new HomomorphicDecryptHandler(fun)); - } if (fun.isExport()) { fun.appendAfterInvokeHandler(new ObjToJsonHandler()); // fun.appendBeforeInvokeHandler(new ReadMeHandler()); @@ -568,6 +561,13 @@ public class ContractProcess { fun.appendAfterInvokeHandler(new MaskHandler()); // } } + if (fun.isHomomorphicEncrypt()) { + LOGGER.info("injectHandlers--------------------------------1"); + fun.appendAfterInvokeHandler(new HomomorphicEncryptHandler(fun)); + } + if (fun.isHomomorphicDecrypt()) { + fun.appendAfterInvokeHandler(new HomomorphicDecryptHandler(fun)); + } } } diff --git a/src/main/java/org/bdware/sc/engine/hook/HomomorphicEncryptHandler.java b/src/main/java/org/bdware/sc/engine/hook/HomomorphicEncryptHandler.java index bcfc695..c0937cd 100644 --- a/src/main/java/org/bdware/sc/engine/hook/HomomorphicEncryptHandler.java +++ b/src/main/java/org/bdware/sc/engine/hook/HomomorphicEncryptHandler.java @@ -56,7 +56,7 @@ public class HomomorphicEncryptHandler implements AnnotationHook { LOGGER.info("HomomorphicEncryptHandler--------------------------------6: " + homoEncryptConf); LOGGER.info("HomomorphicEncryptHandler--------------------------------7: " + ret); LOGGER.info("HomomorphicEncryptHandler--------------------------------8: " + ret.toString()); - LOGGER.info("HomomorphicEncryptHandler--------------------------------9: " + JsonUtil.toJson(ret)); + // LOGGER.info("HomomorphicEncryptHandler--------------------------------9: " + JsonUtil.toJson(ret)); ret = getEncryptResult(homoEncryptConf, response); if (ret != null) { return ret;