Can I initialize Relic with two elliptic curves?

42 views
Skip to first unread message

modp...@gmail.com

unread,
Nov 22, 2020, 1:10:50 PM11/22/20
to relic-discuss
I'm using Relic where I want to perform both some pairing operations using the curve BN_P256, and additionally some conventional elliptic curve operations using the curve SECG_K256. Can Relic handle such multi initialization, or one has to initialize them separately before every operation? More precisely, can I have only single function that looks more or less like this?

int init() {
if (core_init() != RLC_OK) {
            core_clean();
            return RLC_ERR;
        }

// Initialize the pairing and elliptic curve groups.
if (pc_param_set_any() != RLC_OK) {
    core_clean();
    return RLC_ERR;
}

        if (ec_param_set_any() != RLC_OK) {
            core_clean();
            return RLC_ERR;
         }

 // Set the secp256k1 curve, which is used in Bitcoin.
 ep_param_set(SECG_K256);
return RLC_OK;
}
Reply all
Reply to author
Forward
0 new messages