Webserver+3d print

Dependents:   Nucleo

Embed: (wiki syntax)

« Back to documentation index

dh.c File Reference

dh.c File Reference

Diffie-Hellman key exchange. More...

Go to the source code of this file.

Functions

void dhInit (DhContext *context)
 Initialize Diffie-Hellman context.
void dhFree (DhContext *context)
 Release Diffie-Hellman context.
error_t dhGenerateKeyPair (DhContext *context, const PrngAlgo *prngAlgo, void *prngContext)
 Diffie-Hellman key pair generation.
error_t dhCheckPublicKey (DhParameters *params, const Mpi *publicKey)
 Check Diffie-Hellman public value.
error_t dhComputeSharedSecret (DhContext *context, uint8_t *output, size_t outputSize, size_t *outputLength)
 Compute Diffie-Hellman shared secret.

Detailed Description

Diffie-Hellman key exchange.

License

Copyright (C) 2010-2017 Oryx Embedded SARL. All rights reserved.

This file is part of CycloneCrypto Open.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Description

The Diffie-Hellman key agreement protocol allows two users to exchange a secret key over an insecure medium without any prior secrets. Refer to PKCS #3 (Diffie-Hellman Key-Agreement Standard)

Author:
Oryx Embedded SARL (www.oryx-embedded.com)
Version:
1.7.6

Definition in file dh.c.


Function Documentation

error_t dhCheckPublicKey ( DhParameters params,
const Mpi publicKey 
)

Check Diffie-Hellman public value.

Parameters:
[in]paramsPointer to the Diffie-Hellman parameters
[in]publicKeyPublic value to be checked
Returns:
Error code

Definition at line 153 of file dh.c.

error_t dhComputeSharedSecret ( DhContext context,
uint8_t *  output,
size_t  outputSize,
size_t *  outputLength 
)

Compute Diffie-Hellman shared secret.

Parameters:
[in]contextPointer to the Diffie-Hellman context
[out]outputBuffer where to store the shared secret
[in]outputSizeSize of the buffer in bytes
[out]outputLengthLength of the resulting shared secret
Returns:
Error code

Definition at line 189 of file dh.c.

void dhFree ( DhContext context )

Release Diffie-Hellman context.

Parameters:
[in]contextPointer to the Diffie-Hellman context

Definition at line 70 of file dh.c.

error_t dhGenerateKeyPair ( DhContext context,
const PrngAlgo prngAlgo,
void *  prngContext 
)

Diffie-Hellman key pair generation.

Parameters:
[in]contextPointer to the Diffie-Hellman context
[in]prngAlgoPRNG algorithm
[in]prngContextPointer to the PRNG context
Returns:
Error code

Definition at line 90 of file dh.c.

void dhInit ( DhContext context )

Initialize Diffie-Hellman context.

Parameters:
[in]contextPointer to the Diffie-Hellman context

Definition at line 53 of file dh.c.