• Home
  • Raw
  • Download

Lines Matching refs:rd

75     mbedtls_mps_reader const *rd )  in mps_reader_is_accumulating()  argument
78 if( rd->acc == NULL ) in mps_reader_is_accumulating()
81 acc_remaining = rd->acc_share.acc_remaining; in mps_reader_is_accumulating()
86 mbedtls_mps_reader const *rd ) in mps_reader_is_producing() argument
88 unsigned char *frag = rd->frag; in mps_reader_is_producing()
93 mbedtls_mps_reader const *rd ) in mps_reader_is_consuming() argument
95 return( !mps_reader_is_producing( rd ) ); in mps_reader_is_consuming()
99 mbedtls_mps_reader const *rd ) in mps_reader_get_fragment_offset() argument
101 unsigned char *acc = rd->acc; in mps_reader_get_fragment_offset()
107 frag_offset = rd->acc_share.frag_offset; in mps_reader_get_fragment_offset()
112 mbedtls_mps_reader const *rd ) in mps_reader_serving_from_accumulator() argument
116 frag_offset = mps_reader_get_fragment_offset( rd ); in mps_reader_serving_from_accumulator()
117 end = rd->end; in mps_reader_serving_from_accumulator()
122 static inline void mps_reader_zero( mbedtls_mps_reader *rd ) in mps_reader_zero() argument
141 *rd = zero; in mps_reader_zero()
144 int mbedtls_mps_reader_init( mbedtls_mps_reader *rd, in mbedtls_mps_reader_init() argument
151 mps_reader_zero( rd ); in mbedtls_mps_reader_init()
152 rd->acc = acc; in mbedtls_mps_reader_init()
153 rd->acc_len = acc_len; in mbedtls_mps_reader_init()
157 int mbedtls_mps_reader_free( mbedtls_mps_reader *rd ) in mbedtls_mps_reader_free() argument
160 mps_reader_zero( rd ); in mbedtls_mps_reader_free()
164 int mbedtls_mps_reader_feed( mbedtls_mps_reader *rd, in mbedtls_mps_reader_feed() argument
176 MBEDTLS_MPS_STATE_VALIDATE_RAW( mps_reader_is_producing( rd ), in mbedtls_mps_reader_feed()
179 if( mps_reader_is_accumulating( rd ) ) in mbedtls_mps_reader_feed()
181 unsigned char *acc = rd->acc; in mbedtls_mps_reader_feed()
182 mbedtls_mps_size_t acc_remaining = rd->acc_share.acc_remaining; in mbedtls_mps_reader_feed()
183 mbedtls_mps_size_t acc_available = rd->acc_available; in mbedtls_mps_reader_feed()
205 rd->acc_share.acc_remaining = acc_remaining; in mbedtls_mps_reader_feed()
206 rd->acc_available = acc_available; in mbedtls_mps_reader_feed()
216 rd->acc_share.frag_offset = acc_available; in mbedtls_mps_reader_feed()
218 rd->acc_available = acc_available; in mbedtls_mps_reader_feed()
222 rd->acc_share.frag_offset = 0; in mbedtls_mps_reader_feed()
225 rd->frag = new_frag; in mbedtls_mps_reader_feed()
226 rd->frag_len = new_frag_len; in mbedtls_mps_reader_feed()
227 rd->commit = 0; in mbedtls_mps_reader_feed()
228 rd->end = 0; in mbedtls_mps_reader_feed()
233 int mbedtls_mps_reader_get( mbedtls_mps_reader *rd, in mbedtls_mps_reader_get() argument
244 MBEDTLS_MPS_STATE_VALIDATE_RAW( mps_reader_is_consuming( rd ), in mbedtls_mps_reader_get()
247 end = rd->end; in mbedtls_mps_reader_get()
248 frag_offset = mps_reader_get_fragment_offset( rd ); in mbedtls_mps_reader_get()
251 if( mps_reader_serving_from_accumulator( rd ) ) in mbedtls_mps_reader_get()
323 acc_available = rd->acc_available; in mbedtls_mps_reader_get()
341 acc = rd->acc; in mbedtls_mps_reader_get()
349 rd->end = end; in mbedtls_mps_reader_get()
350 rd->pending = 0; in mbedtls_mps_reader_get()
359 frag_len = rd->frag_len; in mbedtls_mps_reader_get()
377 rd->pending = desired - frag_remaining; in mbedtls_mps_reader_get()
380 (unsigned) rd->pending ); in mbedtls_mps_reader_get()
391 frag = rd->frag; in mbedtls_mps_reader_get()
399 rd->end = end; in mbedtls_mps_reader_get()
400 rd->pending = 0; in mbedtls_mps_reader_get()
404 int mbedtls_mps_reader_commit( mbedtls_mps_reader *rd ) in mbedtls_mps_reader_commit() argument
408 MBEDTLS_MPS_STATE_VALIDATE_RAW( mps_reader_is_consuming( rd ), in mbedtls_mps_reader_commit()
411 end = rd->end; in mbedtls_mps_reader_commit()
412 rd->commit = end; in mbedtls_mps_reader_commit()
417 int mbedtls_mps_reader_reclaim( mbedtls_mps_reader *rd, in mbedtls_mps_reader_reclaim() argument
428 MBEDTLS_MPS_STATE_VALIDATE_RAW( mps_reader_is_consuming( rd ), in mbedtls_mps_reader_reclaim()
431 frag = rd->frag; in mbedtls_mps_reader_reclaim()
432 acc = rd->acc; in mbedtls_mps_reader_reclaim()
433 pending = rd->pending; in mbedtls_mps_reader_reclaim()
434 commit = rd->commit; in mbedtls_mps_reader_reclaim()
435 frag_len = rd->frag_len; in mbedtls_mps_reader_reclaim()
437 frag_offset = mps_reader_get_fragment_offset( rd ); in mbedtls_mps_reader_reclaim()
449 rd->end = commit; in mbedtls_mps_reader_reclaim()
453 rd->acc_available = 0; in mbedtls_mps_reader_reclaim()
454 rd->acc_share.acc_remaining = 0; in mbedtls_mps_reader_reclaim()
482 acc_len = rd->acc_len; in mbedtls_mps_reader_reclaim()
515 rd->end = commit; in mbedtls_mps_reader_reclaim()
516 rd->pending = 0; in mbedtls_mps_reader_reclaim()
543 rd->acc_available = backup_len; in mbedtls_mps_reader_reclaim()
544 rd->acc_share.acc_remaining = pending; in mbedtls_mps_reader_reclaim()
550 rd->frag = NULL; in mbedtls_mps_reader_reclaim()
551 rd->frag_len = 0; in mbedtls_mps_reader_reclaim()
553 rd->commit = 0; in mbedtls_mps_reader_reclaim()
554 rd->end = 0; in mbedtls_mps_reader_reclaim()
555 rd->pending = 0; in mbedtls_mps_reader_reclaim()
559 (unsigned) rd->acc_available, (unsigned) rd->acc_len, in mbedtls_mps_reader_reclaim()
560 (unsigned) rd->acc_share.acc_remaining ); in mbedtls_mps_reader_reclaim()