Key exchange without an underlying semigroup
Can this always be turned into an underlying semigroup? I am thinking that it should be possible to glue the different operations and domains/codomains into a semigroup action somehow.


It wouldn't appear so, as there's no reason to expect to be able to perform any operations other than the ones listed in the protocol; in particular, one wouldn't expect to be able to concatenate operations as would be expected in a semigroup.

For example, here's a simple way to turn a public key encryption method (e.g. RSA) into a key exchange method:


Alice generates a public/private key pair $pub_A, priv_A$, and also selects a random nonce $n_A$; she sends $pub_A$ and $n_A$ to Bob
Bob selects a random nonce $n_B$; he encrypts it with $pub_A$, and sends $Enc_{pub_A}(n_B)$ to Alice
Alice uses $priv_A$ to decrypt the ciphertext to recover $n_B$
Then, both Alice and Bob compute $h( n_A, n_B )$ to obtain the shared secret.


In this case, the private values are $priv_A$ and $n_B$; the messages that are exchanged are the values $pub_A, n_A$, and $Enc_{Pub_A}(n_B)$.  It is not at all clear how someone could define an operator that would take an unrelated message/private value pair (e.g. $priv_A$ and $Enc_{Pub_C}(n_D)$, you can consider all four possible pairs), and combine them into a meaningful value.