aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bls.cpp7
-rw-r--r--src/bls_if.cpp4
2 files changed, 11 insertions, 0 deletions
diff --git a/src/bls.cpp b/src/bls.cpp
index 8679ea5..6adc493 100644
--- a/src/bls.cpp
+++ b/src/bls.cpp
@@ -381,6 +381,13 @@ void SecretKey::sign(Sign& sign, const std::string& m) const
HashAndMapToG1(Hm, m);
G1::mul(sign.getInner().sHm, Hm, getInner().s);
}
+// constant time sign
+void SecretKey::signCT(Sign& sign, const std::string& m) const
+{
+ G1 Hm;
+ HashAndMapToG1(Hm, m);
+ G1::mulCT(sign.getInner().sHm, Hm, getInner().s);
+}
void SecretKey::getPop(Sign& pop) const
{
diff --git a/src/bls_if.cpp b/src/bls_if.cpp
index 8fd1a55..4080d70 100644
--- a/src/bls_if.cpp
+++ b/src/bls_if.cpp
@@ -134,6 +134,10 @@ void blsSecretKeySign(const blsSecretKey *sec, blsSign *sign, const char *m, siz
{
((const bls::SecretKey*)sec)->sign(*(bls::Sign*)sign, std::string(m, size));
}
+void blsSecretKeySignCT(const blsSecretKey *sec, blsSign *sign, const char *m, size_t size)
+{
+ ((const bls::SecretKey*)sec)->signCT(*(bls::Sign*)sign, std::string(m, size));
+}
void blsSecretKeySet(blsSecretKey *sec, const blsSecretKey* msk, size_t k, const blsId *id)
{