summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2015-10-06 21:16:36 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2015-10-06 21:16:36 +0200
commitc917cec3ef016b0d872d550fd8b6d9d690c23407 (patch)
treec1d5090bdbb9817fa7a6107c4e240f8efb8b0bb1 /include
parent89f8a35c713fdcc5ed28c33a003639b93e083b7f (diff)
downloadlibuecc-c917cec3ef016b0d872d550fd8b6d9d690c23407.tar
libuecc-c917cec3ef016b0d872d550fd8b6d9d690c23407.zip
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.
Diffstat (limited to 'include')
-rw-r--r--include/libuecc/ecc.h13
1 files changed, 8 insertions, 5 deletions
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 <stdint.h>
+
+
/**
* 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;
/**