Right now, I'm working on coming up with a similarity vs dissimilarity matrix for a set of data points for a clustering algorithm. My question is if I want to use one of the many clustering algorithms given in $R$, such as the K-Medoids algorithm, does it require a similarity or dissimilarity matrix as its parameter?

What's the difference between the two?

If I use the Gower Distance from the Daisy function in R, does it output a similarity or dissimilarity matrix?

Also, let's assume that I have $n$ features and they are all categorical (this is just an example) I a custom distance function where when comparing two data points $G$ and $H$, I use the formula $$\sum\_i^nX\_i$$
where $X\_i = 1 $ if feature $i$ of $G$, $G\_i$ and feature i of $H$, $H\_i$ are equal to each other. So, $$X\_i=1$$if and only if $G\_i=H\_i$ for feature $i$ for all of the $n$ categorical features. Will this result in getting a similarity or dissimilarity matrix?

Also, as mentioned above, if I want to use one of the many clustering algorithms given in $R$, such as the K-Medoids algorithm, does it require a similarity or dissimilarity matrix as its parameter?

In general, does the similarity or dissimilarity matrix get used for these?