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
|
|
|
|
ALGO_SKEIN,
|
|
|
|
ALGO_SKEIN2,
|
|
|
|
ALGO_SKUNK,
|
|
|
|
ALGO_TIMETRAVEL,
|
|
|
|
ALGO_TRIBUS,
|
|
|
|
ALGO_VANILLA,
|
|
|
|
ALGO_VELTOR,
|
|
|
|
ALGO_WHIRLCOIN,
|
|
|
|
ALGO_WHIRLPOOL,
|
|
|
|
ALGO_WHIRLPOOLX,
|
|
|
|
ALGO_WILDKECCAK,
|
|
|
|
ALGO_X11,
|
|
|
|
ALGO_X11EVO,
|
|
|
|
ALGO_X13,
|
|
|
|
ALGO_X14,
|
|
|
|
ALGO_X15,
|
|
|
|
ALGO_X17,
|
|
|
|
ALGO_ZR5,
|
|
|
|
ALGO_AUTO,
|
|
|
|
ALGO_COUNT
|
|
|
|
};
|
|
|
|
|
|
|
|
extern volatile enum sha_algos opt_algo;
|
|
|
|
|
|
|
|
static const char *algo_names[] = {
|
|
|
|
"bastion",
|
|
|
|
"bitcore",
|
|
|
|
"blake",
|
|
|
|
"blake2s",
|
|
|
|
"blakecoin",
|
|
|
|
"bmw",
|
|
|
|
"c11",
|
|
|
|
"cryptolight",
|
|
|
|
"cryptonight",
|
|
|
|
"decred",
|
|
|
|
"deep",
|
|
|
|
"dmd-gr",
|
|
|
|
"equihash",
|
|
|
|
"fresh",
|
|
|
|
"fugue256",
|
|
|
|
"gostd",
|
|
|
|
"groestl",
|
|
|
|
"heavy",
|
|
|
|
"hmq1725",
|
|
|
|
"hsr",
|
|
|
|
"jackpot",
|
|
|
|
"jha",
|
|
|
|
"keccak",
|
|
|
|
"lbry",
|
|
|
|
"luffa",
|
|
|
|
"lyra2",
|
|
|
|
"lyra2v2",
|
|
|
|
"lyra2z",
|
|
|
|
"mjollnir",
|
|
|
|
"myr-gr",
|
|
|
|
"neoscrypt",
|
|
|
|
"nist5",
|
|
|
|
"penta",
|
|
|
|
"phi",
|
|
|
|
"quark",
|
|
|
|
"qubit",
|
|
|
|
"s3",
|
|
|
|
"scrypt",
|
|
|
|
"scrypt-jane",
|
|
|
|
"sha256d",
|
|
|
|
"sha256t",
|
|
|
|
"sia",
|
|
|
|
"sib",
|
|
|
|
"skein",
|
|
|
|
"skein2",
|
|
|
|
"skunk",
|
|
|
|
"timetravel",
|
|
|
|
"tribus",
|
|
|
|
"vanilla",
|
|
|
|
"veltor",
|
|
|
|
"whirlcoin",
|
|
|
|
"whirlpool",
|
|
|
|
"whirlpoolx",
|
|
|
|
"wildkeccak",
|
|
|
|
"x11",
|
|
|
|
"x11evo",
|
|
|
|
"x13",
|
|
|
|
"x14",
|
|
|
|
"x15",
|
|
|
|
"x17",
|
|
|
|
"zr5",
|
|
|
|
"auto", /* reserved for multi algo */
|
|
|
|
""
|
|
|
|
};
|
|
|
|
|
|
|
|
// string to int/enum
|
|
|
|
static inline int algo_to_int(char* arg)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = 0; i < ALGO_COUNT; i++) {
|
|
|
|
if (algo_names[i] && !strcasecmp(arg, algo_names[i])) {
|
|
|
|
return i;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (i == ALGO_COUNT) {
|
|
|
|
// some aliases...
|
|
|
|
if (!strcasecmp("all", arg))
|
|
|
|
i = ALGO_AUTO;
|
|
|
|
else if (!strcasecmp("cryptonight-light", arg))
|
|
|
|
i = ALGO_CRYPTOLIGHT;
|
|
|
|
else if (!strcasecmp("cryptonight-lite", arg))
|
|
|
|
i = ALGO_CRYPTOLIGHT;
|
|
|
|
else if (!strcasecmp("flax", arg))
|
|
|
|
i = ALGO_C11;
|
|
|
|
else if (!strcasecmp("diamond", arg))
|
|
|
|
i = ALGO_DMD_GR;
|
|
|
|
else if (!strcasecmp("equi", arg))
|
|
|
|
i = ALGO_EQUIHASH;
|
|
|
|
else if (!strcasecmp("doom", arg))
|
|
|
|
i = ALGO_LUFFA;
|
|
|
|
else if (!strcasecmp("gost", arg))
|
|
|
|
i = ALGO_GOSTD;
|
|
|
|
else if (!strcasecmp("hmq17", arg))
|
|
|
|
i = ALGO_HMQ1725;
|
|
|
|
else if (!strcasecmp("hshare", arg))
|
|
|
|
i = ALGO_HSR;
|
|
|
|
//else if (!strcasecmp("jackpot", arg))
|
|
|
|
// i = ALGO_JHA;
|
|
|
|
else if (!strcasecmp("lyra2re", arg))
|
|
|
|
i = ALGO_LYRA2;
|
|
|
|
else if (!strcasecmp("lyra2rev2", arg))
|
|
|
|
i = ALGO_LYRA2v2;
|
|
|
|
else if (!strcasecmp("phi1612", arg))
|
|
|
|
i = ALGO_PHI;
|
|
|
|
else if (!strcasecmp("bitcoin", arg))
|
|
|
|
i = ALGO_SHA256D;
|
|
|
|
else if (!strcasecmp("sha256", arg))
|
|
|
|
i = ALGO_SHA256D;
|
|
|
|
else if (!strcasecmp("thorsriddle", arg))
|
|
|
|
i = ALGO_VELTOR;
|
|
|
|
else if (!strcasecmp("timetravel10", arg))
|
|
|
|
i = ALGO_BITCORE;
|
|
|
|
else if (!strcasecmp("whirl", arg))
|
|
|
|
i = ALGO_WHIRLPOOL;
|
|
|
|
else if (!strcasecmp("ziftr", arg))
|
|
|
|
i = ALGO_ZR5;
|
|
|
|
else
|
|
|
|
i = -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
return i;
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|