summaryrefslogtreecommitdiff
path: root/mpi.cpp
diff options
context:
space:
mode:
authorChristian Pointner <equinox@anytun.org>2008-02-20 00:25:29 +0000
committerChristian Pointner <equinox@anytun.org>2008-02-20 00:25:29 +0000
commit7b75dd9d4afd6030fe1837ea7d2d3fcd225ae785 (patch)
treeeb9375dcfd63e78965d844674577491c1dd1a5e9 /mpi.cpp
parentfurther cleanups (diff)
further cleanups
cipher could work now
Diffstat (limited to 'mpi.cpp')
-rw-r--r--mpi.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/mpi.cpp b/mpi.cpp
index 28684f7..39e3408 100644
--- a/mpi.cpp
+++ b/mpi.cpp
@@ -57,6 +57,12 @@ Mpi::Mpi(const u_int8_t * src, u_int32_t len)
gcry_mpi_scan( &val_, GCRYMPI_FMT_STD, src, len, NULL );
}
+Mpi::~Mpi()
+{
+ gcry_mpi_release( val_ );
+}
+
+
void Mpi::operator=(const Mpi &src)
{
val_ = gcry_mpi_copy(src.val_);
@@ -88,6 +94,7 @@ Mpi Mpi::operator*(const unsigned long int n) const
return res;
}
+//TODO: this is outstandingly ugly!!!!!!!!
Mpi Mpi::operator^(const Mpi &b) const
{
u_int32_t a_len=0, b_len=0;
@@ -150,9 +157,3 @@ u_int32_t Mpi::getLen() const
{
return gcry_mpi_get_nbits( val_ );
}
-
-Mpi::~Mpi()
-{
- gcry_mpi_release( val_ );
-}
-