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;
}