mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-05 13:44:41 +02:00
Re-apply spelling error correction
This commit is contained in:
@@ -10,11 +10,11 @@ The Example contains of wolfSSL tls client demo.
|
|||||||
Target host ip address : the host that you want to connect to.(default is 127.0.0.1)
|
Target host ip address : the host that you want to connect to.(default is 127.0.0.1)
|
||||||
|
|
||||||
Note: the example program uses 11111 port. If you want to use different port
|
Note: the example program uses 11111 port. If you want to use different port
|
||||||
, you need to modifiy DEFAULT_PORT definition in the code.
|
, you need to modify DEFAULT_PORT definition in the code.
|
||||||
|
|
||||||
When you want to test the wolfSSL client
|
When you want to test the wolfSSL client
|
||||||
|
|
||||||
1. "make falsh monitor" to load the firmware and see the context
|
1. "make flash monitor" to load the firmware and see the context
|
||||||
2. You can use <wolfssl>/examples/server/server program for test.
|
2. You can use <wolfssl>/examples/server/server program for test.
|
||||||
|
|
||||||
e.g. Launch ./examples/server/server -v 4 -b -i
|
e.g. Launch ./examples/server/server -v 4 -b -i
|
||||||
|
@@ -61,7 +61,7 @@ static void ShowCiphers(void)
|
|||||||
|
|
||||||
#include "wolfssl/wolfcrypt/port/atmel/atmel.h"
|
#include "wolfssl/wolfcrypt/port/atmel/atmel.h"
|
||||||
|
|
||||||
/* when you want to use custome slot allocation */
|
/* when you want to use custom slot allocation */
|
||||||
/* enable the definition CUSTOM_SLOT_ALLOCATION.*/
|
/* enable the definition CUSTOM_SLOT_ALLOCATION.*/
|
||||||
|
|
||||||
#if defined(CUSTOM_SLOT_ALLOCATION)
|
#if defined(CUSTOM_SLOT_ALLOCATION)
|
||||||
@@ -235,7 +235,7 @@ void tls_smp_client_task()
|
|||||||
#if defined(WOLFSSL_ESPWROOM32SE) && defined(HAVE_PK_CALLBACKS) \
|
#if defined(WOLFSSL_ESPWROOM32SE) && defined(HAVE_PK_CALLBACKS) \
|
||||||
&& defined(WOLFSSL_ATECC508A)
|
&& defined(WOLFSSL_ATECC508A)
|
||||||
atcatls_set_callbacks(ctx);
|
atcatls_set_callbacks(ctx);
|
||||||
/* when using custome slot-allocation */
|
/* when using custom slot-allocation */
|
||||||
#if defined(CUSTOM_SLOT_ALLOCATION)
|
#if defined(CUSTOM_SLOT_ALLOCATION)
|
||||||
my_atmel_slotInit();
|
my_atmel_slotInit();
|
||||||
atmel_set_slot_allocator(my_atmel_alloc, my_atmel_free);
|
atmel_set_slot_allocator(my_atmel_alloc, my_atmel_free);
|
||||||
|
@@ -4,7 +4,7 @@ The Example contains of wolfSSL test program.
|
|||||||
|
|
||||||
When you want to run the benchmark program
|
When you want to run the benchmark program
|
||||||
1. "make menuconfig" to configure the program,first
|
1. "make menuconfig" to configure the program,first
|
||||||
1. "make flash" to compile and load the firemware
|
2. "make flash" to compile and load the firmware
|
||||||
2. "make monitor" to see the message
|
3. "make monitor" to see the message
|
||||||
|
|
||||||
See the README.md file in the upper level 'examples' directory for more information about examples.
|
See the README.md file in the upper level 'examples' directory for more information about examples.
|
||||||
|
@@ -59,7 +59,7 @@ static void esp32TimerStart()
|
|||||||
|
|
||||||
static uint64_t esp32elapsedTime()
|
static uint64_t esp32elapsedTime()
|
||||||
{
|
{
|
||||||
/* retturn elapsed time since wc_esp32AesTimeStart() is called in us */
|
/* return elapsed time since wc_esp32AesTimeStart() is called in us */
|
||||||
return esp_timer_get_time() - startTime;
|
return esp_timer_get_time() - startTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -367,7 +367,7 @@ int mp_unitest_mul(const char* strZ, const char* strX, const char* strY, int ver
|
|||||||
}
|
}
|
||||||
|
|
||||||
TEST_ASSERT_EQUAL_STRING_MESSAGE(strZ, bufZ,
|
TEST_ASSERT_EQUAL_STRING_MESSAGE(strZ, bufZ,
|
||||||
"mp_mulmod returns an unexptected result.");
|
"mp_mulmod returns an unexpected result.");
|
||||||
XFREE(bufZ, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
XFREE(bufZ, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@@ -448,7 +448,7 @@ int mp_unitest_mulmod(const char* strZ, const char* strX, const char* strY,
|
|||||||
}
|
}
|
||||||
|
|
||||||
TEST_ASSERT_EQUAL_STRING_MESSAGE(strZ, bufZ,
|
TEST_ASSERT_EQUAL_STRING_MESSAGE(strZ, bufZ,
|
||||||
"mp_mulmod returns an unexptected result.");
|
"mp_mulmod returns an unexpected result.");
|
||||||
XFREE(bufZ, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
XFREE(bufZ, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@@ -529,7 +529,7 @@ int mp_unitest_exptmod(const char* strZ, const char* strX, const char* strY,
|
|||||||
}
|
}
|
||||||
|
|
||||||
TEST_ASSERT_EQUAL_STRING_MESSAGE(strZ, bufZ,
|
TEST_ASSERT_EQUAL_STRING_MESSAGE(strZ, bufZ,
|
||||||
"mp_exptmod returns an unexptected result.");
|
"mp_exptmod returns an unexpected result.");
|
||||||
XFREE(bufZ, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
XFREE(bufZ, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@@ -1124,7 +1124,7 @@ TEST_CASE("wolfssl aes sha256 rsa multi-thread test ", "[wolfssl]")
|
|||||||
vTaskDelay(15000/portTICK_PERIOD_MS);
|
vTaskDelay(15000/portTICK_PERIOD_MS);
|
||||||
exit_loop = true;
|
exit_loop = true;
|
||||||
|
|
||||||
/* wait until ras test finishes */
|
/* wait until rsa test finishes */
|
||||||
while(rsa_elapsedTime<=0){ vTaskDelay(1); }
|
while(rsa_elapsedTime<=0){ vTaskDelay(1); }
|
||||||
|
|
||||||
ESP_LOGI(TAG, "Waiting another %llu s. rsa test would take more time to finish.",
|
ESP_LOGI(TAG, "Waiting another %llu s. rsa test would take more time to finish.",
|
||||||
|
@@ -131,7 +131,7 @@ static void esp_aes_hw_Set_KeyMode(Aes *ctx, ESP32_AESPROCESS mode)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Porcess a one block of AES
|
* Process a one block of AES
|
||||||
*/
|
*/
|
||||||
static void esp_aes_bk(const byte* in, byte* out)
|
static void esp_aes_bk(const byte* in, byte* out)
|
||||||
{
|
{
|
||||||
|
@@ -100,7 +100,7 @@ static void esp_mp_hw_unlock( void )
|
|||||||
/* unlock */
|
/* unlock */
|
||||||
esp_CryptHwMutexUnLock(&mp_mutex);
|
esp_CryptHwMutexUnLock(&mp_mutex);
|
||||||
}
|
}
|
||||||
/* this is based on an aricle by Cetin Kaya Koc, A New Algorighm for Inversion*/
|
/* this is based on an article by Cetin Kaya Koc, A New Algorithm for Inversion*/
|
||||||
/* mod p^k, June 28 2017. */
|
/* mod p^k, June 28 2017. */
|
||||||
static int esp_calc_Mdash(mp_int *M, word32 k, mp_digit* md)
|
static int esp_calc_Mdash(mp_int *M, word32 k, mp_digit* md)
|
||||||
{
|
{
|
||||||
@@ -269,7 +269,7 @@ int esp_mp_mul(fp_int* X, fp_int* Y, fp_int* Z)
|
|||||||
DPORT_REG_WRITE(RSA_MULT_MODE_REG, (hwWords_sz >> 3) - 1 + 8);
|
DPORT_REG_WRITE(RSA_MULT_MODE_REG, (hwWords_sz >> 3) - 1 + 8);
|
||||||
/* step.2 write X, M and r_inv into memory */
|
/* step.2 write X, M and r_inv into memory */
|
||||||
esp_mpint_to_memblock(RSA_MEM_X_BLOCK_BASE, X, Xs, hwWords_sz);
|
esp_mpint_to_memblock(RSA_MEM_X_BLOCK_BASE, X, Xs, hwWords_sz);
|
||||||
/* Y(let-extened) */
|
/* Y(let-extend) */
|
||||||
esp_mpint_to_memblock(RSA_MEM_Z_BLOCK_BASE + (hwWords_sz<<2), Y, Ys, hwWords_sz);
|
esp_mpint_to_memblock(RSA_MEM_Z_BLOCK_BASE + (hwWords_sz<<2), Y, Ys, hwWords_sz);
|
||||||
/* step.3 start process */
|
/* step.3 start process */
|
||||||
process_start(RSA_MULT_START_REG);
|
process_start(RSA_MULT_START_REG);
|
||||||
@@ -373,7 +373,7 @@ int esp_mp_mulmod(fp_int* X, fp_int* Y, fp_int* M, fp_int* Z)
|
|||||||
esp_mpint_to_memblock(RSA_MEM_M_BLOCK_BASE, M, Ms, hwWords_sz);
|
esp_mpint_to_memblock(RSA_MEM_M_BLOCK_BASE, M, Ms, hwWords_sz);
|
||||||
esp_mpint_to_memblock(RSA_MEM_Z_BLOCK_BASE, &r_inv, mp_count_bits(&r_inv),
|
esp_mpint_to_memblock(RSA_MEM_Z_BLOCK_BASE, &r_inv, mp_count_bits(&r_inv),
|
||||||
hwWords_sz);
|
hwWords_sz);
|
||||||
/* step.3 wirite M' into memory */
|
/* step.3 write M' into memory */
|
||||||
DPORT_REG_WRITE(RSA_M_DASH_REG, mp);
|
DPORT_REG_WRITE(RSA_M_DASH_REG, mp);
|
||||||
/* step.4 start process */
|
/* step.4 start process */
|
||||||
process_start(RSA_MULT_START_REG);
|
process_start(RSA_MULT_START_REG);
|
||||||
@@ -438,11 +438,11 @@ int esp_mp_exptmod(fp_int* X, fp_int* Y, word32 Ys, fp_int* M, fp_int* Z)
|
|||||||
}
|
}
|
||||||
/* calculate r_inv = R^2 mode M
|
/* calculate r_inv = R^2 mode M
|
||||||
* where: R = b^n, and b = 2^32
|
* where: R = b^n, and b = 2^32
|
||||||
* accordinalry R^2 = 2^(n*32*2)
|
* accordingly R^2 = 2^(n*32*2)
|
||||||
*/
|
*/
|
||||||
ret = mp_init(&r_inv);
|
ret = mp_init(&r_inv);
|
||||||
if(ret == 0 && (ret = esp_get_rinv(&r_inv, M, (hwWords_sz<<6))) != MP_OKAY) {
|
if(ret == 0 && (ret = esp_get_rinv(&r_inv, M, (hwWords_sz<<6))) != MP_OKAY) {
|
||||||
ESP_LOGE(TAG, "calcurate r_inv failed.");
|
ESP_LOGE(TAG, "calculate r_inv failed.");
|
||||||
mp_clear(&r_inv);
|
mp_clear(&r_inv);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@@ -466,7 +466,7 @@ int esp_mp_exptmod(fp_int* X, fp_int* Y, word32 Ys, fp_int* M, fp_int* Z)
|
|||||||
* of the number.
|
* of the number.
|
||||||
* 3. Write M' to M_PRIME_REG
|
* 3. Write M' to M_PRIME_REG
|
||||||
* 4. Write 1 to MODEXP_START_REG
|
* 4. Write 1 to MODEXP_START_REG
|
||||||
* 5. Wait for the operation to be done. Poll INTERRUPT_REG unitl it reads 1.
|
* 5. Wait for the operation to be done. Poll INTERRUPT_REG until it reads 1.
|
||||||
* (Or until the INTER interrupt is generated.)
|
* (Or until the INTER interrupt is generated.)
|
||||||
* 6. Read the result Z(=Y) from Z_MEM
|
* 6. Read the result Z(=Y) from Z_MEM
|
||||||
* 7. Write 1 to INTERRUPT_REG to clear the interrupt.
|
* 7. Write 1 to INTERRUPT_REG to clear the interrupt.
|
||||||
@@ -481,7 +481,7 @@ int esp_mp_exptmod(fp_int* X, fp_int* Y, word32 Ys, fp_int* M, fp_int* Z)
|
|||||||
esp_mpint_to_memblock(RSA_MEM_M_BLOCK_BASE, M, Ms, hwWords_sz);
|
esp_mpint_to_memblock(RSA_MEM_M_BLOCK_BASE, M, Ms, hwWords_sz);
|
||||||
esp_mpint_to_memblock(RSA_MEM_Z_BLOCK_BASE, &r_inv, mp_count_bits(&r_inv),
|
esp_mpint_to_memblock(RSA_MEM_Z_BLOCK_BASE, &r_inv, mp_count_bits(&r_inv),
|
||||||
hwWords_sz);
|
hwWords_sz);
|
||||||
/* step.3 wirite M' into meory */
|
/* step.3 write M' into memory */
|
||||||
DPORT_REG_WRITE(RSA_M_DASH_REG, mp);
|
DPORT_REG_WRITE(RSA_M_DASH_REG, mp);
|
||||||
/* step.4 start process */
|
/* step.4 start process */
|
||||||
process_start(RSA_START_MODEXP_REG);
|
process_start(RSA_START_MODEXP_REG);
|
||||||
|
@@ -151,7 +151,7 @@ int esp_sha_try_hw_lock(WC_ESP32SHA* ctx)
|
|||||||
ctx->mode = ESP32_SHA_HW;
|
ctx->mode = ESP32_SHA_HW;
|
||||||
} else {
|
} else {
|
||||||
ESP_LOGI(TAG, "someone used. hw is locked.....");
|
ESP_LOGI(TAG, "someone used. hw is locked.....");
|
||||||
ESP_LOGI(TAG, "the rest of operaion will use sw implementation for this sha");
|
ESP_LOGI(TAG, "the rest of operation will use sw implementation for this sha");
|
||||||
ctx->mode = ESP32_SHA_SW;
|
ctx->mode = ESP32_SHA_SW;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -224,7 +224,7 @@ static void esp_process_block(WC_ESP32SHA* ctx, word32 address,
|
|||||||
ESP_LOGV(TAG, "leave esp_process_block");
|
ESP_LOGV(TAG, "leave esp_process_block");
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* retreive sha digest from memory
|
* retrieve sha digest from memory
|
||||||
*/
|
*/
|
||||||
static void esp_digest_state(WC_ESP32SHA* ctx, byte* hash, enum SHA_TYPE sha_type)
|
static void esp_digest_state(WC_ESP32SHA* ctx, byte* hash, enum SHA_TYPE sha_type)
|
||||||
{
|
{
|
||||||
@@ -398,7 +398,7 @@ void esp_sha512_block(struct wc_Sha512* sha, const word32* data, byte isfinal)
|
|||||||
ESP_LOGV(TAG, "leave esp_sha512_block");
|
ESP_LOGV(TAG, "leave esp_sha512_block");
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* sha512 proess. this is used for sha384 too.
|
* sha512 process. this is used for sha384 too.
|
||||||
*/
|
*/
|
||||||
int esp_sha512_process(struct wc_Sha512* sha)
|
int esp_sha512_process(struct wc_Sha512* sha)
|
||||||
{
|
{
|
||||||
@@ -412,7 +412,7 @@ int esp_sha512_process(struct wc_Sha512* sha)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* retreive sha512 digest. this is used for sha384 too.
|
* retrieve sha512 digest. this is used for sha384 too.
|
||||||
*/
|
*/
|
||||||
int esp_sha512_digest_process(struct wc_Sha512* sha, byte blockproc)
|
int esp_sha512_digest_process(struct wc_Sha512* sha, byte blockproc)
|
||||||
{
|
{
|
||||||
|
@@ -60,7 +60,7 @@ void wc_esp32TimerStart()
|
|||||||
|
|
||||||
uint64_t wc_esp32elapsedTime()
|
uint64_t wc_esp32elapsedTime()
|
||||||
{
|
{
|
||||||
/* retturn elapsed time since wc_esp32AesTimeStart() is called in us */
|
/* return elapsed time since wc_esp32AesTimeStart() is called in us */
|
||||||
return esp_timer_get_time() - startTime;
|
return esp_timer_get_time() - startTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user