… | |
… | |
209 | many messages, faster. |
209 | many messages, faster. |
210 | |
210 | |
211 | =head1 Key Exchange |
211 | =head1 Key Exchange |
212 | |
212 | |
213 | As an extension to Ed25519, this module implements a key exchange similar |
213 | As an extension to Ed25519, this module implements a key exchange similar |
214 | (But not identical) to Curve25519. For this, both sides generate a keypair |
214 | to Curve25519, which should be compatible to other implementations of |
215 | and send their public key to the other side. Then both sides can generate |
215 | Curv25519, depending on how the resulting shared secret is hashed. |
216 | the same shared secret using this function: |
216 | |
|
|
217 | To do this, both sides generate a keypair and send their public key to the |
|
|
218 | other side. Then both sides can generate the same shared secret using this |
|
|
219 | function: |
217 | |
220 | |
218 | =over |
221 | =over |
219 | |
222 | |
220 | =item $shared_secret = Crypt::Ed25519::key_exchange $other_public_key, $own_private_key |
223 | =item $shared_secret = Crypt::Ed25519::key_exchange $other_public_key, $own_private_key |
221 | |
224 | |
222 | Return the 32 octet shared secret generated from the given public and |
225 | Return the 32 octet shared secret generated from the given public and |
|
|
226 | private key. |
|
|
227 | |
|
|
228 | The resulting C<$shared_key> should be hashed before use (for example, by |
|
|
229 | using it in a KDF such as HKDF). |
|
|
230 | |
223 | private key. See SYNOPSIS for an actual example. |
231 | See SYNOPSIS for an actual example. |
224 | |
232 | |
225 | =back |
233 | =back |
226 | |
234 | |
227 | =head1 SUPPORT FOR THE PERL MULTICORE SPECIFICATION |
235 | =head1 SUPPORT FOR THE PERL MULTICORE SPECIFICATION |
228 | |
236 | |