Simplify hash family parameter definition

Tento commit je obsažen v:
Joost Rijneveld 2017-07-31 16:50:47 +02:00
rodič 073e093ce0
revize 1e041f25d5
V databázi nebyl nalezen žádný známý klíč pro tento podpis
ID GPG klíče: 307BC77F47D58EE2
2 změnil soubory, kde provedl 7 přidání a 7 odebrání

8
hash.c
Zobrazit soubor

@ -48,16 +48,16 @@ static int core_hash(unsigned char *out, const unsigned int type, const unsigned
buf[keylen + n + i] = in[i];
}
if (n == 32 && XMSS_FUNC == XMSS_SHA2_256) {
if (n == 32 && XMSS_FUNC == XMSS_SHA2) {
SHA256(buf, inlen + keylen + n, out);
}
else if (n == 32 && XMSS_FUNC == XMSS_SHAKE128) {
else if (n == 32 && XMSS_FUNC == XMSS_SHAKE) {
shake128(out, 32, buf, inlen + keylen + n);
}
else if (n == 64 && XMSS_FUNC == XMSS_SHA2_512) {
else if (n == 64 && XMSS_FUNC == XMSS_SHA2) {
SHA512(buf, inlen + keylen + n, out);
}
else if (n == 64 && XMSS_FUNC == XMSS_SHAKE256) {
else if (n == 64 && XMSS_FUNC == XMSS_SHAKE) {
shake256(out, 64, buf, inlen + keylen + n);
}
else {

Zobrazit soubor

@ -131,9 +131,9 @@ nvalues = {
"SHAKE256": 64,
}
for i, func in enumerate(functions):
print("#define XMSS_{} {}".format(func.replace('-', '_'), i))
print("#define XMSS_FUNC", functions.index(param[1]))
print("#define XMSS_SHA2 0")
print("#define XMSS_SHAKE 1")
print("#define XMSS_FUNC", functions.index(param[1]) // 2)
XMSS_N = int(nvalues[param[1]])
print("#define XMSS_N", XMSS_N)