rename convertCipherText to convertCipherTextAtoM

dev
MITSUNARI Shigeo 8 years ago
parent b10cfe6188
commit e3be163f85
  1. 6
      include/mcl/bgn.hpp
  2. 2
      test/bgn_test.cpp

@ -469,7 +469,7 @@ struct BGNT {
convert from CipherTextA to CipherTextM convert from CipherTextA to CipherTextM
cm = ca * Enc(1) cm = ca * Enc(1)
*/ */
void convertCipherText(CipherTextM& cm, const CipherTextA& ca) const void convertCipherTextAtoM(CipherTextM& cm, const CipherTextA& ca) const
{ {
/* /*
Enc(1) = (S, T) = (yP + rP, zP + r xP) = (yP, zP) if r = 0 Enc(1) = (S, T) = (yP + rP, zP + r xP) = (yP, zP) if r = 0
@ -480,11 +480,11 @@ struct BGNT {
BN::millerLoop(cm.g[2], zP, ca.c2.S); BN::millerLoop(cm.g[2], zP, ca.c2.S);
BN::millerLoop(cm.g[3], zP, ca.c2.T); BN::millerLoop(cm.g[3], zP, ca.c2.T);
} }
void convertCipherText(CipherText& cm, const CipherText& ca) const void convertCipherTextAtoM(CipherText& cm, const CipherText& ca) const
{ {
if (ca.isMultiplied()) throw cybozu::Exception("bgn:PublicKey:convertCipherText:already isMultiplied"); if (ca.isMultiplied()) throw cybozu::Exception("bgn:PublicKey:convertCipherText:already isMultiplied");
cm.isMultiplied_ = true; cm.isMultiplied_ = true;
convertCipherText(cm.m, ca.a); convertCipherTextAtoM(cm.m, ca.a);
} }
/* /*
c += Enc(0) c += Enc(0)

@ -125,7 +125,7 @@ CYBOZU_TEST_AUTO(add_mul_add)
CYBOZU_TEST_EQUAL(sec.dec(c[i]), m[i]); CYBOZU_TEST_EQUAL(sec.dec(c[i]), m[i]);
CYBOZU_TEST_ASSERT(!c[i].isMultiplied()); CYBOZU_TEST_ASSERT(!c[i].isMultiplied());
CipherText mc; CipherText mc;
pub.convertCipherText(mc, c[i]); pub.convertCipherTextAtoM(mc, c[i]);
CYBOZU_TEST_ASSERT(mc.isMultiplied()); CYBOZU_TEST_ASSERT(mc.isMultiplied());
CYBOZU_TEST_EQUAL(sec.dec(mc), m[i]); CYBOZU_TEST_EQUAL(sec.dec(mc), m[i]);
} }

Loading…
Cancel
Save