aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMITSUNARI Shigeo <herumi@nifty.com>2018-01-03 21:07:09 +0800
committerMITSUNARI Shigeo <herumi@nifty.com>2018-01-03 21:07:09 +0800
commite4e5c2051b1893a4183f99318945044a905c244f (patch)
tree5f4103ecc80654af47e75c265fb2debf86449f65 /src
parent280d7c84204b3eb1a08993fb20dcddebbf8e2b40 (diff)
downloadtangerine-mcl-e4e5c2051b1893a4183f99318945044a905c244f.tar.gz
tangerine-mcl-e4e5c2051b1893a4183f99318945044a905c244f.tar.zst
tangerine-mcl-e4e5c2051b1893a4183f99318945044a905c244f.zip
[she] add sheDecGiViaGT
Diffstat (limited to 'src')
-rw-r--r--src/she_c_impl.hpp26
1 files changed, 24 insertions, 2 deletions
diff --git a/src/she_c_impl.hpp b/src/she_c_impl.hpp
index 1f5237d..9d29c67 100644
--- a/src/she_c_impl.hpp
+++ b/src/she_c_impl.hpp
@@ -202,7 +202,7 @@ void sheUseDecG1ViaGT(int use)
{
SHE::useDecG1ViaGT(use != 0);
}
-void sheDecG2ViaGT(int use)
+void sheUseDecG2ViaGT(int use)
{
SHE::useDecG2ViaGT(use != 0);
}
@@ -282,7 +282,7 @@ template<class CT>
int decT(mclInt *m, const sheSecretKey *sec, const CT *c)
try
{
- *m = cast(sec)->dec(*cast(c));
+ *m = (cast(sec)->dec)(*cast(c));
return 0;
} catch (std::exception& e) {
fprintf(stderr, "err %s\n", e.what());
@@ -305,6 +305,28 @@ int sheDecGT(mclInt *m, const sheSecretKey *sec, const sheCipherTextGT *c)
}
template<class CT>
+int decViaGTT(mclInt *m, const sheSecretKey *sec, const CT *c)
+ try
+{
+ *m = (cast(sec)->decViaGT)(*cast(c));
+ return 0;
+} catch (std::exception& e) {
+ fprintf(stderr, "err %s\n", e.what());
+ return -1;
+}
+
+int sheDecG1ViaGT(mclInt *m, const sheSecretKey *sec, const sheCipherTextG1 *c)
+{
+ return decViaGTT(m, sec, c);
+}
+
+int sheDecG2ViaGT(mclInt *m, const sheSecretKey *sec, const sheCipherTextG2 *c)
+{
+ return decViaGTT(m, sec, c);
+}
+
+
+template<class CT>
int isZeroT(const sheSecretKey *sec, const CT *c)
try
{