ср, 3 июл. 2019 г. в 00:15, Niels Möller nisse@lysator.liu.se:
Dmitry Eremin-Solenikov dbaryshkov@gmail.com writes:
+union nettle_block8 +{
- uint8_t b[8];
- unsigned long w[8 / sizeof(unsigned long)];
- uint64_t u64;
+};
The "unsigned long w" seems unneeded (in nettle_block16, it could also be retired; it's from a time when Nettle didn't use uint64_t).
Ok, I'll drop both usecases.
Maybe one could do without this union and simply use uint64_t, but then one would need some casts to (uint8_t *). So a union may be clearer.
I preferred union because of symmetry with CMAC-128 code.