According to https://cr.yp.to/highspeed/naclcrypto-20090310.pdf, NaCl derives a MAC key from the shared secret and the nonce in crypto_box
APIs.
Alice uses the first 32 bytes of the long stream (generated from the shared secret and nonce using
salsa20
) to compute an authenticator of the encrypted packet.
However, this procedure is internal. I wonder if there is an API to derive the MAC key manually?