[makerom] Implemented support for secure crypto. Secure crypto is now default. Seeded keyY crypto not yet supported. Time for version 0.16!!!

This commit is contained in:
jakcron
2017-05-25 13:50:03 +08:00
parent 183d95bffa
commit 4f875b0d0b
7 changed files with 94 additions and 80 deletions
-27
View File
@@ -45,14 +45,6 @@ void n128_add(const uint8_t *a, const uint8_t *b, uint8_t *out)
carry = sum >> 8;
out[i] = sum & 0xff;
}
while (carry != 0) {
for (int i = 15; i >= 0; i--) {
sum = out[i] + carry;
carry = sum >> 8;
out[i] = sum & 0xff;
}
}
}
/* out = a - b
@@ -77,25 +69,6 @@ void n128_sub(const uint8_t *a, const uint8_t *b, uint8_t *out)
// set value
out[i] = sum & 0xff;
}
while (carry != 0) {
for (int i = 15; i >= 0; i--) {
sum = out[i] - carry;
// check to see if anything was borrowed from next byte
if (out[i] < carry) {
sum += 0x100;
carry = 1;
}
else {
carry = 0;
}
out[i] = sum & 0xff;
}
}
}
void n128_xor(const uint8_t *a, const uint8_t *b, uint8_t *out)