diff options
author | René Schümann <white06tiger@gmail.com> | 2015-03-20 12:32:29 +0000 |
---|---|---|
committer | René Schümann <white06tiger@gmail.com> | 2015-03-20 12:32:29 +0000 |
commit | 539705d58fc39a28388ff18c695dd406f4ffd1d9 (patch) | |
tree | 51db7a37a66c09f41734ba5573d972aae9f30d71 /plugins/MirOTR/Libgcrypt/mpi/mpi-inv.c | |
parent | 90171f125f36488dc08f5cfe0b0d4b78d995f08d (diff) |
MirOTR: Libgcrypt and Libgpg-error update
Libgcrypt 1.4.6 => 1.6.3
Libgpg-error 1.9 => 1.18
git-svn-id: http://svn.miranda-ng.org/main/trunk@12449 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MirOTR/Libgcrypt/mpi/mpi-inv.c')
-rw-r--r-- | plugins/MirOTR/Libgcrypt/mpi/mpi-inv.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/plugins/MirOTR/Libgcrypt/mpi/mpi-inv.c b/plugins/MirOTR/Libgcrypt/mpi/mpi-inv.c index 5d269466e0..ee6813b1ed 100644 --- a/plugins/MirOTR/Libgcrypt/mpi/mpi-inv.c +++ b/plugins/MirOTR/Libgcrypt/mpi/mpi-inv.c @@ -29,7 +29,7 @@ * 1 = (a*x) mod n */ int -gcry_mpi_invm( gcry_mpi_t x, gcry_mpi_t a, gcry_mpi_t n ) +_gcry_mpi_invm (gcry_mpi_t x, gcry_mpi_t a, gcry_mpi_t n) { #if 0 gcry_mpi_t u, v, u1, u2, u3, v1, v2, v3, q, t1, t2, t3; @@ -165,6 +165,11 @@ gcry_mpi_invm( gcry_mpi_t x, gcry_mpi_t a, gcry_mpi_t n ) int sign; int odd ; + if (!mpi_cmp_ui (a, 0)) + return 0; /* Inverse does not exists. */ + if (!mpi_cmp_ui (n, 1)) + return 0; /* Inverse does not exists. */ + u = mpi_copy(a); v = mpi_copy(n); |