code: private static final byte[] egcd32(byte[] x,byte[] y,byte[] a,byte[] b) {
  		int an, bn = 32, qn, i;
  		for (i = 0; i < 32; i++)
  			x[i] = y[i] = 0;
  		x[0] = 1;
  		an = numsize(a, 32);
  		if (an==0)
  			return y;	/* division by zero */
  		byte[] temp=new byte[32];
  		while (true) {
  			qn = bn - an + 1;
  			divmod(temp, b, bn, a, an);
  			bn = numsize(b, bn);
  			if (bn==0)
  				return x;
  			mula32(y, x, temp, qn, -1);
  
  			qn = an - bn + 1;
  			divmod(temp, a, an, b, bn);
  			an = numsize(a, an);
  			if (an==0)
  				return y;
  			mula32(x, y, temp, qn, -1);
  		}
  	}
docs: /* Returns x if a contains the gcd, y if b.
  Also, the returned buffer contains the inverse of a mod b,
  as 32-byte signed.
  x and y must have 64 bytes space for temporary use.
  requires that a[-1] and b[-1] are valid memory locations