diff --git a/include/relic_pc.h b/include/relic_pc.h index 9d8df2bed..fb98adb5f 100644 --- a/include/relic_pc.h +++ b/include/relic_pc.h @@ -740,6 +740,15 @@ typedef RLC_CAT(RLC_GT_LOWER, t) gt_t; */ #define g1_mul_sec(R, P, K) RLC_CAT(RLC_G1_LOWER, mul_lwreg)(R, P, K) +/** + * Multiplies an element from G_2 by a secret scalar. Computes R = [k]P. + * + * @param[out] R - the result. + * @param[in] P - the element to multiply. + * @param[in] K - the secret scalar. + */ +#define g2_mul_sec(R, P, K) RLC_CAT(RLC_G1_LOWER, mul_lwreg)(R, P, K) + /** * Multiplies an element from a larger group containing G_1 by a scalar. * Computes R = [k]P. @@ -1046,7 +1055,7 @@ void gt_exp(gt_t c, const gt_t a, const bn_t b); * @param[in] a - the element to exponentiate. * @param[in] b - the integer exponent. */ -void gt_exp_key(gt_t c, const gt_t a, const bn_t b); +void gt_exp_sec(gt_t c, const gt_t a, const bn_t b); /** * Exponentiates an element from G_T by a small integer. Computes c = a^b. diff --git a/src/pc/relic_pc_exp.c b/src/pc/relic_pc_exp.c index de9d20488..8d974380a 100644 --- a/src/pc/relic_pc_exp.c +++ b/src/pc/relic_pc_exp.c @@ -308,7 +308,7 @@ void gt_exp(gt_t c, const gt_t a, const bn_t b) { #endif } -void gt_exp_key(gt_t c, const gt_t a, const bn_t b) { +void gt_exp_sec(gt_t c, const gt_t a, const bn_t b) { size_t f = 0; if (bn_bits(b) <= RLC_DIG) { diff --git a/test/test_pc.c b/test/test_pc.c index 2da34e8ed..6e6aaa169 100644 --- a/test/test_pc.c +++ b/test/test_pc.c @@ -1494,7 +1494,7 @@ int exponentiation(void) { TEST_ASSERT(gt_cmp(a, b) == RLC_EQ, end); bn_rand_mod(d, n); gt_exp(b, a, d); - gt_exp_key(c, a, d); + gt_exp_sec(c, a, d); TEST_ASSERT(gt_cmp(b, c) == RLC_EQ, end); gt_rand(b); bn_rand_mod(e, n);