summaryrefslogtreecommitdiffstats
path: root/libtommath
diff options
context:
space:
mode:
Diffstat (limited to 'libtommath')
-rw-r--r--libtommath/astylerc27
-rw-r--r--libtommath/bn_mp_get_long_long.c6
-rw-r--r--libtommath/tommath.h2
3 files changed, 32 insertions, 3 deletions
diff --git a/libtommath/astylerc b/libtommath/astylerc
new file mode 100644
index 0000000..5d63f7a
--- /dev/null
+++ b/libtommath/astylerc
@@ -0,0 +1,27 @@
+# Artistic Style, see http://astyle.sourceforge.net/
+# full documentation, see: http://astyle.sourceforge.net/astyle.html
+#
+# usage:
+# astyle --options=astylerc *.[ch]
+
+## Bracket Style Options
+style=kr
+
+## Tab Options
+indent=spaces=3
+
+## Bracket Modify Options
+
+## Indentation Options
+min-conditional-indent=0
+
+## Padding Options
+pad-header
+unpad-paren
+align-pointer=name
+
+## Formatting Options
+break-after-logical
+max-code-length=120
+convert-tabs
+mode=c
diff --git a/libtommath/bn_mp_get_long_long.c b/libtommath/bn_mp_get_long_long.c
index 4201b4d..61d16ea 100644
--- a/libtommath/bn_mp_get_long_long.c
+++ b/libtommath/bn_mp_get_long_long.c
@@ -13,17 +13,17 @@
*/
/* get the lower unsigned long long of an mp_int, platform dependent */
-unsigned long long mp_get_long_long(const mp_int *a)
+Tcl_WideUInt mp_get_long_long(const mp_int *a)
{
int i;
- unsigned long long res;
+ Tcl_WideUInt res;
if (a->used == 0) {
return 0;
}
/* get number of digits of the lsb we have to read */
- i = MIN(a->used, ((((int)sizeof(unsigned long long) * CHAR_BIT) + DIGIT_BIT - 1) / DIGIT_BIT)) - 1;
+ i = MIN(a->used, ((((int)sizeof(Tcl_WideUInt) * CHAR_BIT) + DIGIT_BIT - 1) / DIGIT_BIT)) - 1;
/* get most significant digit of result */
res = DIGIT(a, i);
diff --git a/libtommath/tommath.h b/libtommath/tommath.h
index c240d80..ce38975 100644
--- a/libtommath/tommath.h
+++ b/libtommath/tommath.h
@@ -45,6 +45,8 @@ extern "C" {
# endif
#endif
+typedef unsigned long long Tcl_WideUInt;
+
/* some default configurations.
*
* A "mp_digit" must be able to hold DIGIT_BIT + 1 bits