code: private long getOptimalPartSize(boolean isUsingEncryption) {
          long optimalPartSize = TransferManagerUtils.calculateOptimalPartSize(origReq, configuration);
          if (isUsingEncryption && optimalPartSize % 32 > 0) {
              // When using encryption, parts must line up correctly along cipher block boundaries
              optimalPartSize = optimalPartSize - (optimalPartSize % 32) + 32 ;
          }
          log.debug("Calculated optimal part size: " + optimalPartSize);
          return optimalPartSize;
      }
docs: Computes and returns the optimal part size for the upload.