public static OperationResult staticOperation(final MessageFrame frame) {
    final Bytes value0 = frame.popStackItem();
    final Bytes value1 = frame.popStackItem();
    final Bytes value2 = frame.popStackItem();

    if (value2.isZero()) {
      frame.pushStackItem(Bytes.EMPTY);
    } else {
      BigInteger b0 = new BigInteger(1, value0.toArrayUnsafe());
      BigInteger b1 = new BigInteger(1, value1.toArrayUnsafe());
      BigInteger b2 = new BigInteger(1, value2.toArrayUnsafe());

      BigInteger result = b0.multiply(b1).mod(b2);
      Bytes resultBytes = Bytes.wrap(result.toByteArray());
      if (resultBytes.size() > 32) {
        resultBytes = resultBytes.slice(resultBytes.size() - 32, 32);
      }

      final byte[] padding = new byte[32 - resultBytes.size()];
      Arrays.fill(padding, result.signum() < 0 ? (byte) 0xFF : 0x00);

      frame.pushStackItem(Bytes.concatenate(Bytes.wrap(padding), resultBytes));
    }

    return mulModSuccess;
  }
Performs MulMod operation.

@param frame the frame
@return the operation result
evm/src/main/java/org/hyperledger/besu/evm/operation/MulModOperation.java