"unsigned long w" comes from the time when Nettle didn't use uint64_t. It is unused now and thus can be dropped.
Signed-off-by: Dmitry Eremin-Solenikov dbaryshkov@gmail.com --- nettle-types.h | 1 - 1 file changed, 1 deletion(-)
diff --git a/nettle-types.h b/nettle-types.h index 5addf3600d69..93a68f3b305c 100644 --- a/nettle-types.h +++ b/nettle-types.h @@ -61,7 +61,6 @@ extern "C" { union nettle_block16 { uint8_t b[16]; - unsigned long w[16 / sizeof(unsigned long)]; uint64_t u64[2]; };
Hmm. This patch has to wait a bit, sent it without actual testing. nettle_block16.w is used by eax (easy to copy with) and gcm (might need performance checks on 32-bit architectures).
ср, 3 июл. 2019 г. в 00:45, Dmitry Eremin-Solenikov dbaryshkov@gmail.com:
"unsigned long w" comes from the time when Nettle didn't use uint64_t. It is unused now and thus can be dropped.
Signed-off-by: Dmitry Eremin-Solenikov dbaryshkov@gmail.com
nettle-types.h | 1 - 1 file changed, 1 deletion(-)
diff --git a/nettle-types.h b/nettle-types.h index 5addf3600d69..93a68f3b305c 100644 --- a/nettle-types.h +++ b/nettle-types.h @@ -61,7 +61,6 @@ extern "C" { union nettle_block16 { uint8_t b[16];
- unsigned long w[16 / sizeof(unsigned long)]; uint64_t u64[2];
};
-- 2.20.1
Dmitry Eremin-Solenikov dbaryshkov@gmail.com writes:
Hmm. This patch has to wait a bit, sent it without actual testing. nettle_block16.w is used by eax (easy to copy with) and gcm (might need performance checks on 32-bit architectures).
I would expect that using the uint64_t field is as efficient (or better, if compilers do it really well), but I haven't checked the generated code on 32-bit archs.
Can we delete the w field from the union without considering it an abi break? I'd expect size and alignment of the union to be unchanged on all but the most obscure architectures. If not, that part of the change has to wait.
Regards, /Niels
Hello,
чт, 4 июл. 2019 г. в 10:06, Niels Möller nisse@lysator.liu.se:
Dmitry Eremin-Solenikov dbaryshkov@gmail.com writes:
Hmm. This patch has to wait a bit, sent it without actual testing. nettle_block16.w is used by eax (easy to copy with) and gcm (might need performance checks on 32-bit architectures).
I would expect that using the uint64_t field is as efficient (or better, if compilers do it really well), but I haven't checked the generated code on 32-bit archs.
Can we delete the w field from the union without considering it an abi break? I'd expect size and alignment of the union to be unchanged on all but the most obscure architectures. If not, that part of the change has to wait.
I don't know. Size remains the same. And I'd assume that alignment is controlled by uint64_t in this case (rather than unsigned long). However these 3 patches (eax, gcm, nettle-types) are completely undependent from the rest of CMAC-64, so they can be applied at any order.
nettle-bugs@lists.lysator.liu.se