Skip to content

X25519 Key Exchange

Philipp Lay edited this page Nov 5, 2017 · 1 revision

X25519 Key Exchange

libeddsa has two functions for X25519-key-exchange:

void x25519_base(uint8_t out[32],
                 const uint8_t scalar[32]);

void x25519(uint8_t out[32],
            const uint8_t scalar[32],
            const uint8_t point[32]);

where x25519_base is used to generate the public-component and x25519 the shared-secret.

Generate public component

Given 32 byte random data secA use the following call to generate public component pubA:

x25519_base(pubA, secA);

Generate shared secret

Given the public component pubB and our secret secA we generate the shared-secret ss with:

x25519(ss, secA, pubB);

Clone this wiki locally