aboutsummaryrefslogtreecommitdiffstats
path: root/include/mpi.h
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>1998-06-16 15:13:28 +0000
committerWerner Koch <[email protected]>1998-06-16 15:13:28 +0000
commite6ac5acbbf56ed8995bfa4d5a28160fa3a5d825f (patch)
tree6ff27595e33dd57d3a8979d245236bd5f404c9b4 /include/mpi.h
parentextensions are now working and fixed a lot of bugs (diff)
downloadgnupg-e6ac5acbbf56ed8995bfa4d5a28160fa3a5d825f.tar.gz
gnupg-e6ac5acbbf56ed8995bfa4d5a28160fa3a5d825f.zip
some more internall structure changes
Diffstat (limited to '')
-rw-r--r--include/mpi.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/include/mpi.h b/include/mpi.h
index 9d93d8505..6e0e42eaa 100644
--- a/include/mpi.h
+++ b/include/mpi.h
@@ -48,7 +48,8 @@ typedef struct mpi_struct {
int nlimbs; /* number of valid limbs */
int nbits; /* the real number of valid bits (info only) */
int sign; /* indicates a negative number */
- int secure; /* array must be allocated in secure memory space */
+ unsigned flags; /* bit 0: array must be allocated in secure memory space */
+ /* bit 1: the mpi is encrypted */
mpi_limb_t *d; /* array with the limbs */
} *MPI;
@@ -56,6 +57,7 @@ typedef struct mpi_struct {
#define mpi_get_nlimbs(a) ((a)->nlimbs)
#define mpi_get_nbit_info(a) ((a)->nbits)
+#define mpi_set_nbit_info(a,b) ((a)->nbits = (b))
#define mpi_is_neg(a) ((a)->sign)
/*-- mpiutil.c --*/
@@ -78,7 +80,10 @@ typedef struct mpi_struct {
void mpi_resize( MPI a, unsigned nlimbs );
MPI mpi_copy( MPI a );
#endif
-#define mpi_is_secure(a) ((a) && (a)->secure)
+#define mpi_is_protected(a) ((a) && ((a)->flags&2))
+#define mpi_set_protect_flag(a) ((a)->flags |= 2)
+#define mpi_clear_protect_flag(a) ((a)->flags &= ~2)
+#define mpi_is_secure(a) ((a) && ((a)->flags&1))
void mpi_set_secure( MPI a );
void mpi_clear( MPI a );
void mpi_set( MPI w, MPI u);