How do I implement authentication on an embedded device?
Two-way authentication requires two pairs of keys.

Your device has a private key, and any other device that has the corresponding public key can send it encrypted messages.

If you want to only accept messages from one (or more) specific device(s), then your device needs to also have a copy of the public key that corresponds to that device's private key. This allows you to verify that the incoming messages were in fact signed by that other device and no one else.