mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-12-23 15:05:41 +00:00
Minor modifications for alt support in des and ecp
1. Add 3des context to be allowed for alternative defintion 2. Move some ecp structs, to disallow alternative definition of them, as other modules rely on them
This commit is contained in:
parent
bf027e736a
commit
05d0e51bb1
|
@ -67,10 +67,6 @@ typedef struct
|
|||
}
|
||||
mbedtls_des_context;
|
||||
|
||||
#else /* MBEDTLS_DES_ALT */
|
||||
#include "des_alt.h"
|
||||
#endif /* MBEDTLS_DES_ALT */
|
||||
|
||||
/**
|
||||
* \brief Triple-DES context structure
|
||||
*/
|
||||
|
@ -80,6 +76,10 @@ typedef struct
|
|||
}
|
||||
mbedtls_des3_context;
|
||||
|
||||
#else /* MBEDTLS_DES_ALT */
|
||||
#include "des_alt.h"
|
||||
#endif /* MBEDTLS_DES_ALT */
|
||||
|
||||
/**
|
||||
* \brief Initialize DES context
|
||||
*
|
||||
|
|
|
@ -43,15 +43,6 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if !defined(MBEDTLS_ECP_ALT)
|
||||
/*
|
||||
* default mbed TLS elliptic curve arithmetic implementation
|
||||
*
|
||||
* (in case MBEDTLS_ECP_ALT is defined then the developer has to provide an
|
||||
* alternative implementation for the whole module and it will replace this
|
||||
* one.)
|
||||
*/
|
||||
|
||||
/**
|
||||
* Domain parameters (curve, subgroup and generator) identifiers.
|
||||
*
|
||||
|
@ -113,6 +104,15 @@ typedef struct
|
|||
}
|
||||
mbedtls_ecp_point;
|
||||
|
||||
#if !defined(MBEDTLS_ECP_ALT)
|
||||
/*
|
||||
* default mbed TLS elliptic curve arithmetic implementation
|
||||
*
|
||||
* (in case MBEDTLS_ECP_ALT is defined then the developer has to provide an
|
||||
* alternative implementation for the whole module and it will replace this
|
||||
* one.)
|
||||
*/
|
||||
|
||||
/**
|
||||
* \brief ECP group structure
|
||||
*
|
||||
|
@ -157,21 +157,6 @@ typedef struct
|
|||
}
|
||||
mbedtls_ecp_group;
|
||||
|
||||
/**
|
||||
* \brief ECP key pair structure
|
||||
*
|
||||
* A generic key pair that could be used for ECDSA, fixed ECDH, etc.
|
||||
*
|
||||
* \note Members purposefully in the same order as struc mbedtls_ecdsa_context.
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
mbedtls_ecp_group grp; /*!< Elliptic curve and base point */
|
||||
mbedtls_mpi d; /*!< our secret value */
|
||||
mbedtls_ecp_point Q; /*!< our public value */
|
||||
}
|
||||
mbedtls_ecp_keypair;
|
||||
|
||||
/**
|
||||
* \name SECTION: Module settings
|
||||
*
|
||||
|
@ -235,6 +220,21 @@ mbedtls_ecp_keypair;
|
|||
#include "ecp_alt.h"
|
||||
#endif /* MBEDTLS_ECP_ALT */
|
||||
|
||||
/**
|
||||
* \brief ECP key pair structure
|
||||
*
|
||||
* A generic key pair that could be used for ECDSA, fixed ECDH, etc.
|
||||
*
|
||||
* \note Members purposefully in the same order as struc mbedtls_ecdsa_context.
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
mbedtls_ecp_group grp; /*!< Elliptic curve and base point */
|
||||
mbedtls_mpi d; /*!< our secret value */
|
||||
mbedtls_ecp_point Q; /*!< our public value */
|
||||
}
|
||||
mbedtls_ecp_keypair;
|
||||
|
||||
/*
|
||||
* Point formats, from RFC 4492's enum ECPointFormat
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue