code: public byte[] calculateAgreement(byte[] publicKey, byte[] privateKey) {
      if (publicKey == null || privateKey == null) {
        throw new IllegalArgumentException("Keys must not be null!");
      }
  
      if (publicKey.length != 32 || privateKey.length != 32) {
        throw new IllegalArgumentException("Keys must be 32 bytes!");
      }
  
      return provider.calculateAgreement(privateKey, publicKey);
    }
docs: Calculates an ECDH agreement.
  
  @param publicKey The Curve25519 (typically remote party's) public key.
  @param privateKey The Curve25519 (typically yours) private key.
  @return A 32-byte shared secret.