Skip to content

Commit b5633f9

Browse files
authored
Merge pull request #7310 from gojimmypi/PR-Revert-Breadcrumbs
Revert some debug breadcrumbs in #7304
2 parents 5daf5ff + 56f3c93 commit b5633f9

2 files changed

Lines changed: 9 additions & 35 deletions

File tree

src/internal.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5428,9 +5428,7 @@ int EccMakeKey(WOLFSSL* ssl, ecc_key* key, ecc_key* peer)
54285428
keySz = ssl->eccTempKeySz;
54295429
/* get curve type */
54305430
if (ssl->ecdhCurveOID > 0) {
5431-
WOLFSSL_MSG("calling ecc_cuve"); /* TODO; review */
54325431
ecc_curve = wc_ecc_get_oid(ssl->ecdhCurveOID, NULL, NULL);
5433-
WOLFSSL_MSG("ecc_curve done");
54345432
}
54355433
#if defined(WOLFSSL_SM2) && defined(WOLFSSL_SM3) && \
54365434
(defined(WOLFSSL_SM4_CBC) || defined(WOLFSSL_SM4_GCM) || \
@@ -5464,9 +5462,7 @@ int EccMakeKey(WOLFSSL* ssl, ecc_key* key, ecc_key* peer)
54645462
else
54655463
#endif
54665464
{
5467-
WOLFSSL_MSG("make key"); /* TODO review */
54685465
ret = wc_ecc_make_key_ex(ssl->rng, keySz, key, ecc_curve);
5469-
WOLFSSL_MSG("make key done");
54705466
}
54715467

54725468
/* make sure the curve is set for TLS */

wolfcrypt/src/ecc.c

Lines changed: 9 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1650,7 +1650,7 @@ static int wc_ecc_curve_load(const ecc_set_type* dp, ecc_curve_spec** pCurve,
16501650
#ifdef ECC_CACHE_CURVE
16511651
int x;
16521652
#endif
1653-
WOLFSSL_ENTER("wc_ecc_curve_load");
1653+
16541654
if (dp == NULL || pCurve == NULL)
16551655
return BAD_FUNC_ARG;
16561656

@@ -1751,8 +1751,6 @@ static int wc_ecc_curve_load(const ecc_set_type* dp, ecc_curve_spec** pCurve,
17511751
wc_UnLockMutex(&ecc_curve_cache_mutex);
17521752
#endif
17531753

1754-
WOLFSSL_LEAVE("wc_ecc_curve_load", ret);
1755-
17561754
return ret;
17571755
}
17581756

@@ -2631,7 +2629,7 @@ int ecc_map_ex(ecc_point* P, mp_int* modulus, mp_digit mp, int ct)
26312629
int err;
26322630

26332631
(void)ct;
2634-
WOLFSSL_ENTER("ecc_map_ex");
2632+
26352633
if (P == NULL || modulus == NULL)
26362634
return ECC_BAD_ARG_E;
26372635

@@ -2660,7 +2658,6 @@ int ecc_map_ex(ecc_point* P, mp_int* modulus, mp_digit mp, int ct)
26602658
#endif /* WOLFSSL_SMALL_STACK_CACHE */
26612659
#endif
26622660
{
2663-
WOLFSSL_MSG("ecc new mp");
26642661
NEW_MP_INT_SIZE(t1, mp_bitsused(modulus), NULL, DYNAMIC_TYPE_ECC);
26652662
NEW_MP_INT_SIZE(t2, mp_bitsused(modulus), NULL, DYNAMIC_TYPE_ECC);
26662663
#ifdef MP_INT_SIZE_CHECK_NULL
@@ -2686,7 +2683,7 @@ int ecc_map_ex(ecc_point* P, mp_int* modulus, mp_digit mp, int ct)
26862683
#endif
26872684
#endif
26882685
}
2689-
WOLFSSL_MSG("ecc init");
2686+
26902687
err = INIT_MP_INT_SIZE(t1, mp_bitsused(modulus));
26912688
if (err == MP_OKAY) {
26922689
err = INIT_MP_INT_SIZE(t2, mp_bitsused(modulus));
@@ -3838,7 +3835,7 @@ int wc_ecc_mulmod_ex2(const mp_int* k, ecc_point* G, ecc_point* R, mp_int* a,
38383835
ecc_key key;
38393836
#endif
38403837
mp_digit mp;
3841-
WOLFSSL_ENTER("wc_ecc_mulmod_ex2");
3838+
38423839
if (k == NULL || G == NULL || R == NULL || modulus == NULL) {
38433840
return ECC_BAD_ARG_E;
38443841
}
@@ -4000,30 +3997,22 @@ static int wc_ecc_new_point_ex(ecc_point** point, void* heap)
40003997
int err = MP_OKAY;
40013998
ecc_point* p;
40023999

4003-
WOLFSSL_ENTER("wc_ecc_new_point_ex");
40044000
if (point == NULL) {
40054001
return BAD_FUNC_ARG;
40064002
}
40074003

40084004
p = *point;
40094005
#ifndef WOLFSSL_NO_MALLOC
40104006
if (p == NULL) {
4011-
WOLFSSL_MSG_EX("XMALLOC ecc_point %d bytes.", sizeof(ecc_point));
4012-
p = (ecc_point*)XMALLOC(sizeof(ecc_point), heap, DYNAMIC_TYPE_ECC);
4013-
WOLFSSL_MSG("XMALLOC ecc_point complete.");
4014-
}
4015-
else {
4016-
WOLFSSL_MSG("XMALLOC ecc_point skipped! (p == NULL)");
4007+
p = (ecc_point*)XMALLOC(sizeof(ecc_point), heap, DYNAMIC_TYPE_ECC);
40174008
}
40184009
#endif
40194010
if (p == NULL) {
4020-
WOLFSSL_MSG("failed to XMALLOC ecc_point");
40214011
return MEMORY_E;
40224012
}
40234013
XMEMSET(p, 0, sizeof(ecc_point));
40244014

40254015
#ifndef ALT_ECC_SIZE
4026-
WOLFSSL_MSG("mp_init_multi for ecc x,y,z (!ALT_ECC_SIZE)");
40274016
err = mp_init_multi(p->x, p->y, p->z, NULL, NULL, NULL);
40284017
if (err != MP_OKAY) {
40294018
WOLFSSL_MSG("mp_init_multi failed.");
@@ -4033,7 +4022,6 @@ static int wc_ecc_new_point_ex(ecc_point** point, void* heap)
40334022
return err;
40344023
}
40354024
#else
4036-
WOLFSSL_MSG("alt_fp_init ecc x,y,z (ALT_ECC_SIZE)");
40374025
p->x = (mp_int*)&p->xyz[0];
40384026
p->y = (mp_int*)&p->xyz[1];
40394027
p->z = (mp_int*)&p->xyz[2];
@@ -4044,8 +4032,6 @@ static int wc_ecc_new_point_ex(ecc_point** point, void* heap)
40444032

40454033
*point = p;
40464034
(void)heap;
4047-
WOLFSSL_LEAVE("wc_ecc_new_point_ex", err);
4048-
40494035
return err;
40504036
} /* wc_ecc_new_point_ex */
40514037

@@ -5192,7 +5178,6 @@ int wc_ecc_gen_k(WC_RNG* rng, int size, mp_int* k, mp_int* order)
51925178
#ifndef WOLFSSL_ECC_GEN_REJECT_SAMPLING
51935179
int err;
51945180
byte buf[ECC_MAXSIZE_GEN];
5195-
WOLFSSL_ENTER("wc_ecc_gen_k");
51965181

51975182
if (rng == NULL || size < 0 || size + 8 > ECC_MAXSIZE_GEN || k == NULL ||
51985183
order == NULL) {
@@ -5278,7 +5263,6 @@ int wc_ecc_gen_k(WC_RNG* rng, int size, mp_int* k, mp_int* order)
52785263
wc_MemZero_Check(buf, ECC_MAXSIZE_GEN);
52795264
#endif
52805265

5281-
WOLFSSL_LEAVE("wc_ecc_gen_k", err);
52825266
return err;
52835267
#endif
52845268
#else
@@ -5318,9 +5302,9 @@ static int ecc_make_pub_ex(ecc_key* key, ecc_curve_spec* curve,
53185302
#ifdef HAVE_ECC_MAKE_PUB
53195303
ecc_point* pub;
53205304
#endif /* HAVE_ECC_MAKE_PUB */
5305+
53215306
(void)rng;
53225307

5323-
WOLFSSL_ENTER("ecc_make_pub_ex");
53245308
if (key == NULL) {
53255309
return BAD_FUNC_ARG;
53265310
}
@@ -5417,7 +5401,6 @@ static int ecc_make_pub_ex(ecc_key* key, ecc_curve_spec* curve,
54175401
ecc_point lcl_base;
54185402
base = &lcl_base;
54195403
#endif
5420-
54215404
err = wc_ecc_new_point_ex(&base, key->heap);
54225405

54235406
/* read in the x/y for this key */
@@ -5474,7 +5457,7 @@ static int ecc_make_pub_ex(ecc_key* key, ecc_curve_spec* curve,
54745457
}
54755458

54765459
RESTORE_VECTOR_REGISTERS();
5477-
WOLFSSL_LEAVE("ecc_make_pub_ex", err);
5460+
54785461
return err;
54795462
}
54805463

@@ -5535,8 +5518,6 @@ static int _ecc_make_key_ex(WC_RNG* rng, int keysize, ecc_key* key,
55355518
int curve_id, int flags)
55365519
{
55375520
int err = 0;
5538-
WOLFSSL_ENTER("_ecc_make_key_ex");
5539-
55405521
#if defined(WOLFSSL_CRYPTOCELL) && !defined(WOLFSSL_ATECC508A) && \
55415522
!defined(WOLFSSL_ATECC608A)
55425523
const CRYS_ECPKI_Domain_t* pDomain;
@@ -5835,6 +5816,7 @@ static int _ecc_make_key_ex(WC_RNG* rng, int keysize, ecc_key* key,
58355816
err = WC_KEY_SIZE_E;
58365817
#else
58375818
DECLARE_CURVE_SPECS(ECC_CURVE_FIELD_COUNT);
5819+
58385820
/* setup the key variables */
58395821
#ifndef ALT_ECC_SIZE
58405822
err = mp_init(key->k);
@@ -5846,15 +5828,13 @@ static int _ecc_make_key_ex(WC_RNG* rng, int keysize, ecc_key* key,
58465828

58475829
/* load curve info */
58485830
if (err == MP_OKAY) {
5849-
WOLFSSL_MSG("load curve specs");
58505831
ALLOC_CURVE_SPECS(ECC_CURVE_FIELD_COUNT, err);
58515832
if (err != MP_OKAY) {
58525833
WOLFSSL_MSG("ALLOC_CURVE_SPECS failed");
58535834
}
58545835
}
58555836

58565837
if (err == MP_OKAY) {
5857-
58585838
err = wc_ecc_curve_load(key->dp, &curve, ECC_CURVE_FIELD_ALL);
58595839
if (err != MP_OKAY) {
58605840
WOLFSSL_MSG("wc_ecc_curve_load failed");
@@ -5907,7 +5887,6 @@ static int _ecc_make_key_ex(WC_RNG* rng, int keysize, ecc_key* key,
59075887
#endif
59085888

59095889
#endif /* HAVE_ECC_MAKE_PUB */
5910-
WOLFSSL_LEAVE("_ecc_make_key_ex", err);
59115890

59125891
return err;
59135892
#endif /* !WOLF_CRYPTO_CB_ONLY_ECC */
@@ -5918,9 +5897,9 @@ int wc_ecc_make_key_ex2(WC_RNG* rng, int keysize, ecc_key* key, int curve_id,
59185897
int flags)
59195898
{
59205899
int err;
5921-
WOLFSSL_ENTER("wc_ecc_make_key_ex2");
59225900

59235901
SAVE_VECTOR_REGISTERS(return _svr_ret;);
5902+
59245903
err = _ecc_make_key_ex(rng, keysize, key, curve_id, flags);
59255904

59265905
#if (FIPS_VERSION_GE(5,0) || defined(WOLFSSL_VALIDATE_ECC_KEYGEN)) && \
@@ -5946,7 +5925,6 @@ int wc_ecc_make_key_ex2(WC_RNG* rng, int keysize, ecc_key* key, int curve_id,
59465925
WOLFSSL_ABI
59475926
int wc_ecc_make_key_ex(WC_RNG* rng, int keysize, ecc_key* key, int curve_id)
59485927
{
5949-
WOLFSSL_ENTER("wc_ecc_make_key_ex");
59505928
return wc_ecc_make_key_ex2(rng, keysize, key, curve_id, WC_ECC_FLAG_NONE);
59515929
}
59525930

0 commit comments

Comments
 (0)