curveToID function
Get the ID of a given Elliptic curve.
Implementation
int curveToID(String curve) {
switch (curve) {
case 'ed25519':
return 0;
case 'P256':
return 1;
case 'secp256k1':
return 2;
default:
throw 'Curve not supported';
}
}