summaryrefslogtreecommitdiffstats
path: root/mpi
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>1998-01-30 17:23:16 +0100
committerWerner Koch <wk@gnupg.org>1998-01-30 17:23:16 +0100
commit4539178daec927b7eb4fbf716851730959b8d8cb (patch)
treeb7bd0083d2dfdf9079891e094266c6f7f9530d55 /mpi
parent version 0.2.1 (diff)
downloadgnupg2-4539178daec927b7eb4fbf716851730959b8d8cb.tar.xz
gnupg2-4539178daec927b7eb4fbf716851730959b8d8cb.zip
*** empty log message ***
Diffstat (limited to 'mpi')
-rw-r--r--mpi/mpicoder.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/mpi/mpicoder.c b/mpi/mpicoder.c
index 75583996d..b371fa64a 100644
--- a/mpi/mpicoder.c
+++ b/mpi/mpicoder.c
@@ -244,14 +244,21 @@ mpi_print( FILE *fp, MPI a, int mode )
u32
mpi_get_keyid( MPI a, u32 *keyid )
{
-#if BYTES_PER_MPI_LIMB != 4
- #error Make this function work with other LIMB sizes
-#endif
+#if BYTES_PER_MPI_LIMB == 4
if( keyid ) {
keyid[0] = a->nlimbs >= 2? a->d[1] : 0;
keyid[1] = a->nlimbs >= 1? a->d[0] : 0;
}
return a->nlimbs >= 1? a->d[0] : 0;
+#elif BYTES_PER_MPI_LIMB == 8
+ if( keyid ) {
+ keyid[0] = a->nlimbs? (u32)(a->d[0] >> 32) : 0;
+ keyid[1] = a->nlimbs? (u32)(a->d[0] & 0xffffffff) : 0;
+ }
+ return a->nlimbs? (u32)(a->d[0] & 0xffffffff) : 0;
+#else
+ #error Make this function work with other LIMB sizes
+#endif
}