Subject: Zerucha's OPGP?

From: Rodney Thayer <[email-masked]>
Date: Wed, 29 Mar 2000 05:57:29 -0800

anyone actually found a copy of Zerucha's code lately?  www.cryptography.org
seens to not have it (an 'opgp', that is)

---

From: Tom Zerucha <[email-masked]>
Date: Wed, 29 Mar 2000 16:56:33 -0500

> seens to not have it (an 'opgp', that is)

http://cryptography.org/crypto/[RANDOM]/pgp/palmopgp/

has an openssl version, though it might be a little datd.

http://cryptography.org/crypto/[RANDOM]/pgp/opgp/

has the 0.99x version

If anyone else wants to host it, feel free to do so.

Here is a (OOPS, REVERSED) patch against 0.99x for OpenSSL 0.9.4:

diff -Bbur opgp-1.0a/libopgp.doc opgp99x/libopgp.doc
--- opgp-1.0a/libopgp.doc	Wed Mar 29 16:45:06 2000
+++ opgp99x/libopgp.doc	Mon Aug 24 01:12:01 1998
@@ -1,4 +1,4 @@
-PGPlib 1.00 Free Open PGP toolkit
+PGPlib 1.00 (prerelease) Open PGP toolkit
 
 opgplib is a set of routines designed to implement OpenPGP according to the
 IETF specification using SSLeay and zlib.
@@ -42,8 +42,7 @@
 
 MAIN
 
-opgp is a command line program that allows easy script (batch) access
-for encryption and signature functions within the library.
+opgp is a not-quite compatible version of PGP5.0.
 
 See opgp -q usage for updates, but briefly, opgp without encryption parameters
 will process until it gets text or a literal packet, and thus duplicates most
diff -Bbur opgp-1.0a/opgplib/getkey.c opgp99x/opgplib/getkey.c
--- opgp-1.0a/opgplib/getkey.c	Wed Mar 29 16:44:35 2000
+++ opgp99x/opgplib/getkey.c	Sat Jul 18 00:07:12 1998
@@ -186,7 +186,7 @@
             continue;
           rsatmp->d = PGP_mpiBN(&bp);
           rsatmp->q = PGP_mpiBN(&bp), rsatmp->p = PGP_mpiBN(&bp);
-          BN_mul(temp = BN_new(), rsatmp->q, rsatmp->p, ctx);  /* n=pq? */
+          BN_mul(temp = BN_new(), rsatmp->q, rsatmp->p);  /* n=pq? */
           if (BN_cmp(temp, rsatmp->n) != 0) {
             RSA_free(rsatmp);
             BN_free(temp);
diff -Bbur opgp-1.0a/opgplib/pkdec.c opgp99x/opgplib/pkdec.c
--- opgp-1.0a/opgplib/pkdec.c	Wed Mar 29 16:44:37 2000
+++ opgp99x/opgplib/pkdec.c	Sat Jul 18 00:07:12 1998
@@ -29,13 +29,13 @@
   if (j == 16 || j == 20) {
     u8_t cbuf[1024];            /* size of key */
     BN_CTX *ctx = BN_CTX_new();
-    BIGNUM *a, *b, *c = BN_new();
+    BIGNUM *a, *b, *c;
     DH *dhkey = deckey;
 
     a = PGP_mpiBN(&bp);
     b = PGP_mpiBN(&bp);
     BN_mod_exp(a, a, dhkey->priv_key, dhkey->p, ctx);
-    BN_mod_inverse(c, a, dhkey->p, ctx);
+    c = BN_mod_inverse(a, dhkey->p, ctx);
     BN_mod_mul(a, c, b, dhkey->p, ctx);
     DH_free(dhkey), BN_clear_free(b), BN_clear_free(c), BN_CTX_free(ctx);
     j = BN_bn2bin(a, cbuf);
diff -Bbur opgp-1.0a/opgplib/sigchk.c opgp99x/opgplib/sigchk.c
--- opgp-1.0a/opgplib/sigchk.c	Wed Mar 29 16:44:40 2000
+++ opgp99x/opgplib/sigchk.c	Mon Aug 24 01:13:04 1998
@@ -10,10 +10,10 @@
                       u8_t * hash, int hlen)
 {
   BN_CTX *ctx = BN_CTX_new();
-  BIGNUM *t1 = BN_new(), *t2 = BN_new(), *t3 = BN_new(), *u2 = BN_new();
+  BIGNUM *t1 = BN_new(), *t2 = BN_new(), *t3 = BN_new(), *u2 = NULL;
   int ret;
 
-  BN_mod_inverse(u2, u1, dsakey->q, ctx);
+  u2 = BN_mod_inverse(u1, dsakey->q, ctx);
   BN_bin2bn(hash, hlen, t3);
   BN_mod_mul(t3, t3, u2, dsakey->q, ctx);
   BN_mod_mul(u2, r, u2, dsakey->q, ctx);
diff -Bbur opgp-1.0a/opgplib/sigmak.c opgp99x/opgplib/sigmak.c
--- opgp-1.0a/opgplib/sigmak.c	Wed Mar 29 16:44:41 2000
+++ opgp99x/opgplib/sigmak.c	Mon Aug 24 01:13:04 1998
@@ -62,9 +62,9 @@
     BN_mod_exp(u1, ((DSA *) seckey)->g, u2, ((DSA *) seckey)->p, ctx);
     BN_mod(r, u1, ((DSA *) seckey)->q, ctx);
     /* Compute  u1 = inv(u2) (t2 + xr) mod q */
-    BN_mul(u1, ((DSA *) seckey)->priv_key, r, ctx);
+    BN_mul(u1, ((DSA *) seckey)->priv_key, r);
     BN_add(u1, u1, t2);
-    BN_mod_inverse(t1, u2, ((DSA *) seckey)->q, ctx);
+    t1 = BN_mod_inverse(u2, ((DSA *) seckey)->q, ctx);
     BN_mod_mul(u1, u1, t1, ((DSA *) seckey)->q, ctx);
     DSA_free(((DSA *) seckey));
   } else
diff -Bbur opgp-1.0a/paths.mak opgp99x/paths.mak
--- opgp-1.0a/paths.mak	Wed Mar 29 16:44:27 2000
+++ opgp99x/paths.mak	Mon Jun  8 11:28:33 1998
@@ -1,6 +1,6 @@
 SSLPATH = /usr/local/ssl
 LIBPATH = -L$(SSLPATH)/lib
-INCLUDE = -I$(SSLPATH)/include/openssl -I$(SSLPATH)/include
+INCLUDE = -I$(SSLPATH)/include
 CFLAGS = -Wall $(INCLUDE) -O6 -s
 
 #where to put the files

---

From: Thomas Roessler <[email-masked]>
Date: Thu, 30 Mar 2000 00:29:13 +0200

Tom,

would you mind to check out
http://cryptome.org/bernstein-bxa.org?  

I think you can now legally make your implementation
accessible to the general public, even outside the United
States, so we can use it as a reference module for some of
the interoperability testing.

Thanks.

-- 
http://www.guug.de/~roessler/