code: private static BigInteger adjustJ(BigInteger J, BigInteger modulus) {
          byte[] ba = J.toByteArray();
          int last = ba[ba.length - 1];
  
          if ((last & 0x0F) == 0x0C) {
              return J;
          }
  
          BigInteger twelve = new BigInteger("12");
          byte[] modulus2 = modulus.subtract(twelve).toByteArray();
          int last2 = modulus2[modulus2.length - 1];
  
          if ((last & 0x0F) == (last2 & 0x0F)) {
              return modulus.subtract(J);
          }
  
          return null;
      }
docs: entweder x oder n-x zurueckgeben