| /components/utilities/ymodem/ |
| A D | ymodem.c | 103 if (rt_device_read(ctx->dev, 0, ctx->buf, 1) == 1) in _rym_read_code() 247 if (ctx->buf[1] != 0 || ctx->buf[2] != 0xFF) in _rym_do_handshake() 256 if (ctx->on_begin && ctx->on_begin(ctx, ctx->buf + 3, data_sz - 5) != RYM_CODE_ACK) in _rym_do_handshake() 291 if (ctx->on_begin && ctx->on_begin(ctx, ctx->buf + 3, data_sz - 5) != RYM_CODE_SOH) in _rym_do_send_handshake() 330 if ((ctx->buf[1] + ctx->buf[2]) != 0xFF) in _rym_trans_data() 354 *code = ctx->on_data(ctx, ctx->buf + 3, data_sz); in _rym_trans_data() 451 code = ctx->on_data(ctx, ctx->buf + 3, data_sz - 5); in _rym_do_send_trans() 481 ctx->on_end(ctx, ctx->buf + 3, 128); in _rym_do_fin() 509 if (ctx->buf[1] != 0 || ctx->buf[2] != 0xFF) in _rym_do_fin() 519 if (ctx->on_begin && ctx->on_begin(ctx, ctx->buf + 3, data_sz - 5) != RYM_CODE_ACK) in _rym_do_fin() [all …]
|
| A D | ry_sy.c | 44 struct rym_ctx *ctx, in _rym_recv_begin() argument 78 struct rym_ctx *ctx, in _rym_recv_data() argument 100 struct rym_ctx *ctx, in _rym_recv_end() argument 199 struct custom_ctx *ctx = rt_calloc(1, sizeof(*ctx)); in rym_download_file() local 201 if (!ctx) in rym_download_file() 206 ctx->fd = -1; in rym_download_file() 211 rt_free(ctx); in rym_download_file() 220 struct custom_ctx *ctx = rt_calloc(1, sizeof(*ctx)); in rym_upload_file() local 221 if (!ctx) in rym_upload_file() 226 ctx->fd = -1; in rym_upload_file() [all …]
|
| /components/drivers/hwcrypto/ |
| A D | hw_gcm.c | 26 struct rt_hwcrypto_ctx *ctx; in rt_hwcrypto_gcm_create() local 29 if (ctx) in rt_hwcrypto_gcm_create() 33 return ctx; in rt_hwcrypto_gcm_create() 41 void rt_hwcrypto_gcm_destroy(struct rt_hwcrypto_ctx *ctx) in rt_hwcrypto_gcm_destroy() argument 43 rt_hwcrypto_ctx_destroy(ctx); in rt_hwcrypto_gcm_destroy() 147 return rt_hwcrypto_symmetric_setiv(ctx, iv, len); in rt_hwcrypto_gcm_setiv() 162 return rt_hwcrypto_symmetric_getiv(ctx, iv, len); in rt_hwcrypto_gcm_getiv() 173 rt_hwcrypto_symmetric_set_ivoff(ctx, iv_off); in rt_hwcrypto_gcm_set_ivoff() 184 rt_hwcrypto_symmetric_get_ivoff(ctx, iv_off); in rt_hwcrypto_gcm_get_ivoff() 215 void rt_hwcrypto_gcm_reset(struct rt_hwcrypto_ctx *ctx) in rt_hwcrypto_gcm_reset() argument [all …]
|
| A D | hw_hash.c | 25 struct rt_hwcrypto_ctx *ctx; in rt_hwcrypto_hash_create() local 28 return ctx; in rt_hwcrypto_hash_create() 36 void rt_hwcrypto_hash_destroy(struct rt_hwcrypto_ctx *ctx) in rt_hwcrypto_hash_destroy() argument 38 rt_hwcrypto_ctx_destroy(ctx); in rt_hwcrypto_hash_destroy() 52 if (ctx && ((struct hwcrypto_hash *)ctx)->ops->finish) in rt_hwcrypto_hash_finish() 54 … return ((struct hwcrypto_hash *)ctx)->ops->finish((struct hwcrypto_hash *)ctx, output, length); in rt_hwcrypto_hash_finish() 70 if (ctx && ((struct hwcrypto_hash *)ctx)->ops->update) in rt_hwcrypto_hash_update() 72 … return ((struct hwcrypto_hash *)ctx)->ops->update((struct hwcrypto_hash *)ctx, input, length); in rt_hwcrypto_hash_update() 95 void rt_hwcrypto_hash_reset(struct rt_hwcrypto_ctx *ctx) in rt_hwcrypto_hash_reset() argument 97 rt_hwcrypto_ctx_reset(ctx); in rt_hwcrypto_hash_reset() [all …]
|
| A D | hwcrypto.c | 25 if (ctx) in rt_hwcrypto_set_type() 55 if (ctx && ctx->device->ops->reset) in rt_hwcrypto_ctx_reset() 57 ctx->device->ops->reset(ctx); in rt_hwcrypto_ctx_reset() 79 err = ctx->device->ops->create(ctx); in rt_hwcrypto_ctx_init() 107 if (ctx == RT_NULL) in rt_hwcrypto_ctx_create() 109 return ctx; in rt_hwcrypto_ctx_create() 116 rt_free(ctx); in rt_hwcrypto_ctx_create() 117 ctx = RT_NULL; in rt_hwcrypto_ctx_create() 119 return ctx; in rt_hwcrypto_ctx_create() 136 ctx->device->ops->destroy(ctx); in rt_hwcrypto_ctx_destroy() [all …]
|
| A D | hw_symmetric.c | 25 struct rt_hwcrypto_ctx *ctx; in rt_hwcrypto_symmetric_create() local 28 return ctx; in rt_hwcrypto_symmetric_create() 38 rt_hwcrypto_ctx_destroy(ctx); in rt_hwcrypto_symmetric_destroy() 58 if (ctx == RT_NULL) in rt_hwcrypto_symmetric_crypt() 148 if (ctx && len <= RT_HWCRYPTO_IV_MAX_SIZE) in rt_hwcrypto_symmetric_setiv() 174 if (ctx && len >= symmetric_ctx->iv_len) in rt_hwcrypto_symmetric_getiv() 191 if (ctx) in rt_hwcrypto_symmetric_set_ivoff() 207 if (ctx && iv_off) in rt_hwcrypto_symmetric_get_ivoff() 250 if (ctx != RT_NULL) in rt_hwcrypto_symmetric_reset() 261 rt_hwcrypto_ctx_reset(ctx); in rt_hwcrypto_symmetric_reset() [all …]
|
| A D | hw_rng.c | 27 struct rt_hwcrypto_ctx *ctx; in rt_hwcrypto_rng_create() local 29 ctx = rt_hwcrypto_ctx_create(device, HWCRYPTO_TYPE_RNG, sizeof(struct hwcrypto_rng)); in rt_hwcrypto_rng_create() 30 return ctx; in rt_hwcrypto_rng_create() 38 void rt_hwcrypto_rng_destroy(struct rt_hwcrypto_ctx *ctx) in rt_hwcrypto_rng_destroy() argument 41 if (ctx == ctx_default) in rt_hwcrypto_rng_destroy() 45 rt_hwcrypto_ctx_destroy(ctx); in rt_hwcrypto_rng_destroy() 87 rt_uint32_t rt_hwcrypto_rng_update_ctx(struct rt_hwcrypto_ctx *ctx) in rt_hwcrypto_rng_update_ctx() argument 89 if (ctx) in rt_hwcrypto_rng_update_ctx() 91 return ((struct hwcrypto_rng *)ctx)->ops->update((struct hwcrypto_rng *)ctx); in rt_hwcrypto_rng_update_ctx()
|
| A D | hw_gcm.h | 56 void rt_hwcrypto_gcm_destroy(struct rt_hwcrypto_ctx *ctx); 67 rt_err_t rt_hwcrypto_gcm_start(struct rt_hwcrypto_ctx *ctx, const rt_uint8_t *add, 79 rt_err_t rt_hwcrypto_gcm_finish(struct rt_hwcrypto_ctx *ctx, const rt_uint8_t *tag, 93 rt_err_t rt_hwcrypto_gcm_crypt(struct rt_hwcrypto_ctx *ctx, hwcrypto_mode mode, 105 rt_err_t rt_hwcrypto_gcm_setkey(struct rt_hwcrypto_ctx *ctx, 117 rt_err_t rt_hwcrypto_gcm_getkey(struct rt_hwcrypto_ctx *ctx, 129 rt_err_t rt_hwcrypto_gcm_setiv(struct rt_hwcrypto_ctx *ctx, 141 rt_err_t rt_hwcrypto_gcm_getiv(struct rt_hwcrypto_ctx *ctx, 150 void rt_hwcrypto_gcm_set_ivoff(struct rt_hwcrypto_ctx *ctx, rt_int32_t iv_off); 158 void rt_hwcrypto_gcm_get_ivoff(struct rt_hwcrypto_ctx *ctx, rt_int32_t *iv_off); [all …]
|
| A D | hw_symmetric.h | 82 void rt_hwcrypto_symmetric_destroy(struct rt_hwcrypto_ctx *ctx); 95 rt_err_t rt_hwcrypto_symmetric_crypt(struct rt_hwcrypto_ctx *ctx, hwcrypto_mode mode, 107 rt_err_t rt_hwcrypto_symmetric_setkey(struct rt_hwcrypto_ctx *ctx, const rt_uint8_t *key, rt_uint32… 118 int rt_hwcrypto_symmetric_getkey(struct rt_hwcrypto_ctx *ctx, rt_uint8_t *key, rt_uint32_t bitlen); 129 rt_err_t rt_hwcrypto_symmetric_setiv(struct rt_hwcrypto_ctx *ctx, const rt_uint8_t *iv, rt_size_t l… 140 int rt_hwcrypto_symmetric_getiv(struct rt_hwcrypto_ctx *ctx, rt_uint8_t *iv, rt_size_t len); 148 void rt_hwcrypto_symmetric_set_ivoff(struct rt_hwcrypto_ctx *ctx, rt_int32_t iv_off); 156 void rt_hwcrypto_symmetric_get_ivoff(struct rt_hwcrypto_ctx *ctx, rt_int32_t *iv_off); 173 void rt_hwcrypto_symmetric_reset(struct rt_hwcrypto_ctx *ctx); 183 rt_err_t rt_hwcrypto_symmetric_set_type(struct rt_hwcrypto_ctx *ctx, hwcrypto_type type);
|
| A D | hw_crc.c | 78 void rt_hwcrypto_crc_destroy(struct rt_hwcrypto_ctx *ctx) in rt_hwcrypto_crc_destroy() argument 80 rt_hwcrypto_ctx_destroy(ctx); in rt_hwcrypto_crc_destroy() 92 rt_uint32_t rt_hwcrypto_crc_update(struct rt_hwcrypto_ctx *ctx, in rt_hwcrypto_crc_update() argument 96 struct hwcrypto_crc *crc_ctx = (struct hwcrypto_crc *)ctx; in rt_hwcrypto_crc_update() 97 if (ctx && crc_ctx->ops->update) in rt_hwcrypto_crc_update() 110 void rt_hwcrypto_crc_cfg(struct rt_hwcrypto_ctx *ctx, in rt_hwcrypto_crc_cfg() argument 115 ((struct hwcrypto_crc *)ctx)->crc_cfg = *cfg; in rt_hwcrypto_crc_cfg()
|
| /components/libc/posix/io/eventfd/ |
| A D | eventfd.c | 74 rt_free(ctx); in eventfd_close() 92 count = ctx->count; in eventfd_poll() 140 if (ctx->count <= 0) in eventfd_read() 164 counter_num = ctx->count; in eventfd_read() 167 ctx->count -= counter_num; in eventfd_read() 170 rt_mutex_release(&ctx->lock); in eventfd_read() 239 rt_mutex_release(&ctx->lock); in eventfd_write() 256 if (ctx == RT_NULL) in rt_eventfd_create() 262 ctx->count = count; in rt_eventfd_create() 263 ctx->flags = flags; in rt_eventfd_create() [all …]
|
| /components/drivers/usb/cherryusb/platform/uf2/ |
| A D | bootuf2.c | 216 err = bootuf2_flash_write(ctx->cached_address, ctx->cache, ctx->cached_bytes); in bootuf2_flash_flush() 220 err, ctx->cached_address, ctx->cached_bytes); in bootuf2_flash_flush() 224 ctx->cached_bytes = 0; in bootuf2_flash_flush() 233 if ((ctx->cached_bytes && ((ctx->cached_address + ctx->cached_bytes) != uf2->TargetAddress)) || in bootuf2_flash_write_internal() 234 (ctx->cached_bytes == ctx->cache_size)) { in bootuf2_flash_write_internal() 241 memcpy(ctx->cache + ctx->cached_bytes, uf2->Data, uf2->PayloadSize); in bootuf2_flash_write_internal() 243 ctx->cached_address = uf2->TargetAddress - ctx->cached_bytes; in bootuf2_flash_write_internal() 253 ctx = &bootuf2_disk; in bootuf2_init() 257 ctx->cached_bytes = 0; in bootuf2_init() 265 ctx = &bootuf2_disk; in boot2uf2_read_sector() [all …]
|
| /components/drivers/usb/cherryusb/platform/lvgl/ |
| A D | usbh_hid_lvgl.c | 116 } else if (ctx->mouse.x >= width * ctx->mouse.sensitivity) { in usbh_hid_lvgl_read_mouse() 117 ctx->mouse.x = (width * ctx->mouse.sensitivity) - 1; in usbh_hid_lvgl_read_mouse() 121 } else if (ctx->mouse.y >= height * ctx->mouse.sensitivity) { in usbh_hid_lvgl_read_mouse() 122 ctx->mouse.y = (height * ctx->mouse.sensitivity) - 1; in usbh_hid_lvgl_read_mouse() 188 } else if (ctx->mouse.x >= width * ctx->mouse.sensitivity) { in hpm_lvgl_indev_read_cb() 189 ctx->mouse.x = (width * ctx->mouse.sensitivity) - 1; in hpm_lvgl_indev_read_cb() 194 ctx->mouse.y = (height * ctx->mouse.sensitivity) - 1; in hpm_lvgl_indev_read_cb() 200 data->point.x = ctx->mouse.x / ctx->mouse.sensitivity; in hpm_lvgl_indev_read_cb() 201 data->point.y = ctx->mouse.y / ctx->mouse.sensitivity; in hpm_lvgl_indev_read_cb() 205 data->point.x = ctx->mouse.y / ctx->mouse.sensitivity; in hpm_lvgl_indev_read_cb() [all …]
|
| /components/net/lwip/lwip-2.1.2/src/netif/ppp/polarssl/ |
| A D | md4.c | 77 ctx->total[0] = 0; in md4_starts() 78 ctx->total[1] = 0; in md4_starts() 109 A = ctx->state[0]; in md4_process() 110 B = ctx->state[1]; in md4_process() 111 C = ctx->state[2]; in md4_process() 112 D = ctx->state[3]; in md4_process() 183 ctx->state[0] += A; in md4_process() 184 ctx->state[1] += B; in md4_process() 185 ctx->state[2] += C; in md4_process() 213 md4_process( ctx, ctx->buffer ); in md4_update() [all …]
|
| A D | md5.c | 76 ctx->total[0] = 0; in md5_starts() 77 ctx->total[1] = 0; in md5_starts() 113 A = ctx->state[0]; in md5_process() 114 B = ctx->state[1]; in md5_process() 115 C = ctx->state[2]; in md5_process() 116 D = ctx->state[3]; in md5_process() 202 ctx->state[0] += A; in md5_process() 203 ctx->state[1] += B; in md5_process() 204 ctx->state[2] += C; in md5_process() 232 md5_process( ctx, ctx->buffer ); in md5_update() [all …]
|
| A D | sha1.c | 76 ctx->total[0] = 0; in sha1_starts() 77 ctx->total[1] = 0; in sha1_starts() 121 A = ctx->state[0]; in sha1_process() 122 B = ctx->state[1]; in sha1_process() 123 C = ctx->state[2]; in sha1_process() 124 D = ctx->state[3]; in sha1_process() 125 E = ctx->state[4]; in sha1_process() 235 ctx->state[0] += A; in sha1_process() 236 ctx->state[1] += B; in sha1_process() 266 sha1_process( ctx, ctx->buffer ); in sha1_update() [all …]
|
| A D | arc4.c | 48 void arc4_setup( arc4_context *ctx, unsigned char *key, int keylen ) in arc4_setup() argument 53 ctx->x = 0; in arc4_setup() 54 ctx->y = 0; in arc4_setup() 55 m = ctx->m; in arc4_setup() 76 void arc4_crypt( arc4_context *ctx, unsigned char *buf, int buflen ) in arc4_crypt() argument 81 x = ctx->x; in arc4_crypt() 82 y = ctx->y; in arc4_crypt() 83 m = ctx->m; in arc4_crypt() 97 ctx->x = x; in arc4_crypt() 98 ctx->y = y; in arc4_crypt()
|
| /components/net/lwip/lwip-2.0.3/src/netif/ppp/polarssl/ |
| A D | md4.c | 77 ctx->total[0] = 0; in md4_starts() 78 ctx->total[1] = 0; in md4_starts() 109 A = ctx->state[0]; in md4_process() 110 B = ctx->state[1]; in md4_process() 111 C = ctx->state[2]; in md4_process() 112 D = ctx->state[3]; in md4_process() 183 ctx->state[0] += A; in md4_process() 184 ctx->state[1] += B; in md4_process() 185 ctx->state[2] += C; in md4_process() 213 md4_process( ctx, ctx->buffer ); in md4_update() [all …]
|
| A D | md5.c | 76 ctx->total[0] = 0; in md5_starts() 77 ctx->total[1] = 0; in md5_starts() 113 A = ctx->state[0]; in md5_process() 114 B = ctx->state[1]; in md5_process() 115 C = ctx->state[2]; in md5_process() 116 D = ctx->state[3]; in md5_process() 202 ctx->state[0] += A; in md5_process() 203 ctx->state[1] += B; in md5_process() 204 ctx->state[2] += C; in md5_process() 232 md5_process( ctx, ctx->buffer ); in md5_update() [all …]
|
| A D | sha1.c | 76 ctx->total[0] = 0; in sha1_starts() 77 ctx->total[1] = 0; in sha1_starts() 121 A = ctx->state[0]; in sha1_process() 122 B = ctx->state[1]; in sha1_process() 123 C = ctx->state[2]; in sha1_process() 124 D = ctx->state[3]; in sha1_process() 125 E = ctx->state[4]; in sha1_process() 235 ctx->state[0] += A; in sha1_process() 236 ctx->state[1] += B; in sha1_process() 266 sha1_process( ctx, ctx->buffer ); in sha1_update() [all …]
|
| A D | arc4.c | 48 void arc4_setup( arc4_context *ctx, unsigned char *key, int keylen ) in arc4_setup() argument 53 ctx->x = 0; in arc4_setup() 54 ctx->y = 0; in arc4_setup() 55 m = ctx->m; in arc4_setup() 76 void arc4_crypt( arc4_context *ctx, unsigned char *buf, int buflen ) in arc4_crypt() argument 81 x = ctx->x; in arc4_crypt() 82 y = ctx->y; in arc4_crypt() 83 m = ctx->m; in arc4_crypt() 97 ctx->x = x; in arc4_crypt() 98 ctx->y = y; in arc4_crypt()
|
| /components/net/lwip/lwip-2.1.2/src/netif/ppp/ |
| A D | chap-md5.c | 65 lwip_md5_context ctx; in chap_md5_verify_response() local 76 lwip_md5_init(&ctx); in chap_md5_verify_response() 77 lwip_md5_starts(&ctx); in chap_md5_verify_response() 78 lwip_md5_update(&ctx, &idbyte, 1); in chap_md5_verify_response() 81 lwip_md5_finish(&ctx, hash); in chap_md5_verify_response() 82 lwip_md5_free(&ctx); in chap_md5_verify_response() 98 lwip_md5_context ctx; in chap_md5_make_response() local 105 lwip_md5_init(&ctx); in chap_md5_make_response() 106 lwip_md5_starts(&ctx); in chap_md5_make_response() 107 lwip_md5_update(&ctx, &idbyte, 1); in chap_md5_make_response() [all …]
|
| /components/net/lwip/lwip-2.0.3/src/netif/ppp/ |
| A D | chap-md5.c | 65 lwip_md5_context ctx; in chap_md5_verify_response() local 76 lwip_md5_init(&ctx); in chap_md5_verify_response() 77 lwip_md5_starts(&ctx); in chap_md5_verify_response() 78 lwip_md5_update(&ctx, &idbyte, 1); in chap_md5_verify_response() 81 lwip_md5_finish(&ctx, hash); in chap_md5_verify_response() 82 lwip_md5_free(&ctx); in chap_md5_verify_response() 98 lwip_md5_context ctx; in chap_md5_make_response() local 105 lwip_md5_init(&ctx); in chap_md5_make_response() 106 lwip_md5_starts(&ctx); in chap_md5_make_response() 107 lwip_md5_update(&ctx, &idbyte, 1); in chap_md5_make_response() [all …]
|
| /components/net/lwip/lwip-2.0.3/src/apps/snmp/ |
| A D | snmpv3_mbedtls.c | 58 mbedtls_md_context_t ctx; in snmpv3_auth() local 72 mbedtls_md_init(&ctx); in snmpv3_auth() 73 if(mbedtls_md_setup(&ctx, md_info, 1) != 0) { in snmpv3_auth() 88 if (mbedtls_md_hmac_update(&ctx, &byte, 1) != 0) { in snmpv3_auth() 93 if (mbedtls_md_hmac_finish(&ctx, hmac_out) != 0) { in snmpv3_auth() 97 mbedtls_md_free(&ctx); in snmpv3_auth() 101 mbedtls_md_free(&ctx); in snmpv3_auth() 113 mbedtls_cipher_context_t ctx; in snmpv3_crypt() local 120 mbedtls_cipher_init(&ctx); in snmpv3_crypt() 215 mbedtls_cipher_free(&ctx); in snmpv3_crypt() [all …]
|
| /components/net/lwip/lwip-2.1.2/src/apps/snmp/ |
| A D | snmpv3_mbedtls.c | 58 mbedtls_md_context_t ctx; in snmpv3_auth() local 72 mbedtls_md_init(&ctx); in snmpv3_auth() 73 if (mbedtls_md_setup(&ctx, md_info, 1) != 0) { in snmpv3_auth() 88 if (mbedtls_md_hmac_update(&ctx, &byte, 1) != 0) { in snmpv3_auth() 93 if (mbedtls_md_hmac_finish(&ctx, hmac_out) != 0) { in snmpv3_auth() 97 mbedtls_md_free(&ctx); in snmpv3_auth() 101 mbedtls_md_free(&ctx); in snmpv3_auth() 113 mbedtls_cipher_context_t ctx; in snmpv3_crypt() local 120 mbedtls_cipher_init(&ctx); in snmpv3_crypt() 226 mbedtls_cipher_free(&ctx); in snmpv3_crypt() [all …]
|