code: void updateProviderIfNeeded() {
          try {
              spiAndProviderUpdater.updateAndGetSpiAndProvider(null, spi, provider);
          } catch (Exception lastException) {
              ProviderException e = new ProviderException
                      ("Could not construct CipherSpi instance");
              if (lastException != null) {
                  e.initCause(lastException);
              }
              throw e;
          }
      }
docs: Choose the Spi from the first provider available. Used if
  delayed provider selection is not possible because init()
  is not the first method called.