code: public void setAlgorithm(KeyAgreementType dh) 
  	{
  		log("DH algorithm set: " + getDHName(dhMode) + " -> " + getDHName(dh));
  		try {
  			if(dhMode != null && dh.keyType == dhMode.keyType) return;
  			dhMode = dh;
  			switch (dhMode.keyType) {
  		        case KeyAgreementType.DH_MODE_DH3K:
  		    		byte[] dhGen = new byte[384];
  		    		Arrays.zero(dhGen);
  		    		dhGen[383] = 0x02;
  		    		dhSystem = new DHCryptoSystem(DH_PRIME, dhGen);
  		    		dhKeyPair = dhSystem.createDHKeyPair();
  		    		clearEcdh();
  		    		break;
  		        case KeyAgreementType.DH_MODE_EC25:
  		        	ecSystem = new ECCryptoSystem(ECCryptoSystem.EC256R1);
  		        	ecKeyPair = ecSystem.createECKeyPair();
  		        	clearDh();
  			        break;
  		        case KeyAgreementType.DH_MODE_EC38:
  		        default:
  		        	ecSystem = new ECCryptoSystem(ECCryptoSystem.EC384R1);
  		        	ecKeyPair = ecSystem.createECKeyPair();
  		        	clearDh();
  			        break;
  	        }
  		} catch (InvalidCryptoSystemException e) {
  	        // TODO Auto-generated catch block
  	        e.printStackTrace();
          } catch (UnsupportedCryptoSystemException e) {
  	        // TODO Auto-generated catch block
  	        e.printStackTrace();
          } catch (CryptoTokenException e) {
  	        // TODO Auto-generated catch block
  	        e.printStackTrace();
          } catch (CryptoUnsupportedOperationException e) {
  	        // TODO Auto-generated catch block
  	        e.printStackTrace();
          }
  	}
docs: DH3K RIM implementation is currently buggy and DOES NOT WORK!!!