Skip to content

Commit

Permalink
ECDH: Fix whitespace and permission problems
Browse files Browse the repository at this point in the history
  • Loading branch information
Christoph M. Wintersteiger authored and yanesca committed Aug 19, 2019
1 parent 0082f9d commit ea24394
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 30 deletions.
12 changes: 6 additions & 6 deletions 3rdparty/CMakeLists.txt
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
add_subdirectory(everest)

set(src_thirdparty
${src_everest}
PARENT_SCOPE
)
add_subdirectory(everest)

set(src_thirdparty
${src_everest}
PARENT_SCOPE
)
19 changes: 10 additions & 9 deletions 3rdparty/everest/CMakeLists.txt
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
include_directories(include include/everest include/everest/kremlib)

set(src_everest
${CMAKE_CURRENT_SOURCE_DIR}/library/everest.c
${CMAKE_CURRENT_SOURCE_DIR}/library/Hacl_Curve25519.c
${CMAKE_CURRENT_SOURCE_DIR}/library/x25519.c
${CMAKE_CURRENT_SOURCE_DIR}/library/kremlib/FStar_UInt64_FStar_UInt32_FStar_UInt16_FStar_UInt8.c
PARENT_SCOPE
)
include_directories(include include/everest include/everest/kremlib)

set(src_everest
${CMAKE_CURRENT_SOURCE_DIR}/library/everest.c
${CMAKE_CURRENT_SOURCE_DIR}/library/Hacl_Curve25519.c
${CMAKE_CURRENT_SOURCE_DIR}/library/x25519.c
${CMAKE_CURRENT_SOURCE_DIR}/library/kremlib/FStar_UInt64_FStar_UInt32_FStar_UInt16_FStar_UInt8.c
PARENT_SCOPE
)

4 changes: 3 additions & 1 deletion 3rdparty/everest/include/everest/kremlin/internal/callconv.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@
#endif
#endif

/* TODO: review these two definitions and understand why they're needed. */
/* Since KreMLin emits the inline keyword unconditionally, we follow the
* guidelines at https://gcc.gnu.org/onlinedocs/gcc/Inline.html and make this
* __inline__ to ensure the code compiles with -std=c90 and earlier. */
#ifdef __GNUC__
# define inline __inline__
#endif
Expand Down
Empty file modified 3rdparty/everest/include/everest/x25519.h
100755 → 100644
Empty file.
Empty file modified include/mbedtls/ecdsa.h
100755 → 100644
Empty file.
26 changes: 12 additions & 14 deletions library/ecdh.c
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -220,20 +220,18 @@ int mbedtls_ecdh_setup( mbedtls_ecdh_context *ctx, mbedtls_ecp_group_id grp_id )
switch( grp_id )
{
#if defined(MBEDTLS_ECDH_VARIANT_EVEREST_ENABLED)
case MBEDTLS_ECP_DP_CURVE25519:
{
ctx->point_format = MBEDTLS_ECP_PF_COMPRESSED;
ctx->var = MBEDTLS_ECDH_VARIANT_EVEREST;
ctx->grp_id = grp_id;
return( mbedtls_everest_setup( &ctx->ctx.everest_ecdh, grp_id ) );
}
#endif
default:
ctx->point_format = MBEDTLS_ECP_PF_UNCOMPRESSED;
ctx->var = MBEDTLS_ECDH_VARIANT_MBEDTLS_2_0;
ctx->grp_id = grp_id;
ecdh_init_internal( &ctx->ctx.mbed_ecdh );
return( ecdh_setup_internal( &ctx->ctx.mbed_ecdh, grp_id ) );
case MBEDTLS_ECP_DP_CURVE25519:
ctx->point_format = MBEDTLS_ECP_PF_COMPRESSED;
ctx->var = MBEDTLS_ECDH_VARIANT_EVEREST;
ctx->grp_id = grp_id;
return( mbedtls_everest_setup( &ctx->ctx.everest_ecdh, grp_id ) );
#endif
default:
ctx->point_format = MBEDTLS_ECP_PF_UNCOMPRESSED;
ctx->var = MBEDTLS_ECDH_VARIANT_MBEDTLS_2_0;
ctx->grp_id = grp_id;
ecdh_init_internal( &ctx->ctx.mbed_ecdh );
return( ecdh_setup_internal( &ctx->ctx.mbed_ecdh, grp_id ) );
}
#endif
}
Expand Down
Empty file modified library/ecdsa.c
100755 → 100644
Empty file.
Empty file modified programs/test/benchmark.c
100755 → 100644
Empty file.

0 comments on commit ea24394

Please sign in to comment.