diff options
-rw-r--r-- | libtommath/bn_mp_export.c | 10 | ||||
-rw-r--r-- | libtommath/bn_mp_import.c | 10 |
2 files changed, 10 insertions, 10 deletions
diff --git a/libtommath/bn_mp_export.c b/libtommath/bn_mp_export.c index 6477dd9..58d71d5 100644 --- a/libtommath/bn_mp_export.c +++ b/libtommath/bn_mp_export.c @@ -31,12 +31,12 @@ int mp_export(void* rop, size_t* countp, int order, size_t size, } if (endian == 0) { - union {
- unsigned int i;
- char c[4];
+ union { + unsigned int i; + char c[4]; } lint; - lint.i = 0x01020304;
-
+ lint.i = 0x01020304; + endian = (lint.c[0] == 4) ? -1 : 1; } diff --git a/libtommath/bn_mp_import.c b/libtommath/bn_mp_import.c index c615a84..d9248fd 100644 --- a/libtommath/bn_mp_import.c +++ b/libtommath/bn_mp_import.c @@ -27,12 +27,12 @@ int mp_import(mp_int* rop, size_t count, int order, size_t size, mp_zero(rop); if (endian == 0) { - union {
- unsigned int i;
- char c[4];
+ union { + unsigned int i; + char c[4]; } lint; - lint.i = 0x01020304;
-
+ lint.i = 0x01020304; + endian = (lint.c[0] == 4) ? -1 : 1; } |