summaryrefslogtreecommitdiffstats
path: root/mpi
diff options
context:
space:
mode:
Diffstat (limited to 'mpi')
-rw-r--r--mpi/mpi.c5
-rw-r--r--mpi/mpi.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/mpi/mpi.c b/mpi/mpi.c
index 24df7c30..20a48a12 100644
--- a/mpi/mpi.c
+++ b/mpi/mpi.c
@@ -2998,6 +2998,11 @@ int mp_count_bits(mp_int *mp)
/* }}} */
+int mp_is_pow_two(mp_int *mp)
+{
+ return s_mp_ispow2(mp) >= 0;
+}
+
/* {{{ mp_read_radix(mp, str, radix) */
/*
diff --git a/mpi/mpi.h b/mpi/mpi.h
index 49ccd294..fb9e47e8 100644
--- a/mpi/mpi.h
+++ b/mpi/mpi.h
@@ -223,6 +223,7 @@ int mp_unsigned_bin_size(mp_int *mp);
mp_err mp_to_unsigned_bin(mp_int *mp, unsigned char *str);
int mp_count_bits(mp_int *mp);
+int mp_is_pow_two(mp_int *mp);
#if MP_COMPAT_MACROS
#define mp_read_raw(mp, str, len) mp_read_signed_bin((mp), (str), (len))