From c917cec3ef016b0d872d550fd8b6d9d690c23407 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 6 Oct 2015 21:16:36 +0200 Subject: Use stdint types where reasonable Using uint32_t instead of unsigned int for the unpacked work struct ensures the code is working correctly on ABIs with ints narrower than 32 bits. While this would constitute a API/ABI change on some systems in theory, most likely all systems using libuecc so far have uint8_t == unsigned char and uint32_t == unsigned int. Also, coding style cleanup. --- include/libuecc/ecc.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/libuecc/ecc.h b/include/libuecc/ecc.h index 5d75150..98d756c 100644 --- a/include/libuecc/ecc.h +++ b/include/libuecc/ecc.h @@ -27,6 +27,9 @@ #ifndef _LIBUECC_ECC_H_ #define _LIBUECC_ECC_H_ +#include + + /** * A 256 bit integer * @@ -34,7 +37,7 @@ */ typedef union _ecc_int256 { /** Data bytes */ - unsigned char p[32]; + uint8_t p[32]; } ecc_int256_t; /** @@ -44,10 +47,10 @@ typedef union _ecc_int256 { * it should always be packed. */ typedef struct _ecc_25519_work { - unsigned int X[32]; - unsigned int Y[32]; - unsigned int Z[32]; - unsigned int T[32]; + uint32_t X[32]; + uint32_t Y[32]; + uint32_t Z[32]; + uint32_t T[32]; } ecc_25519_work_t; /** -- cgit v1.2.3