Changeset 5261 for pjproject/trunk/third_party/srtp/crypto/replay/rdb.c
- Timestamp:
- Mar 15, 2016 3:57:39 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/third_party/srtp/crypto/replay/rdb.c
r4130 r5261 45 45 46 46 47 #ifdef HAVE_CONFIG_H 48 #include <config.h> 49 #endif 50 47 51 #include "rdb.h" 48 52 … … 71 75 72 76 err_status_t 73 rdb_check(const rdb_t *rdb, uint32_t index) {77 rdb_check(const rdb_t *rdb, uint32_t p_index) { 74 78 75 79 /* if the index appears after (or at very end of) the window, its good */ 76 if ( index >= rdb->window_start + rdb_bits_in_bitmask)80 if (p_index >= rdb->window_start + rdb_bits_in_bitmask) 77 81 return err_status_ok; 78 82 79 83 /* if the index appears before the window, its bad */ 80 if ( index < rdb->window_start)84 if (p_index < rdb->window_start) 81 85 return err_status_replay_old; 82 86 83 87 /* otherwise, the index appears within the window, so check the bitmask */ 84 if (v128_get_bit(&rdb->bitmask, ( index - rdb->window_start)) == 1)88 if (v128_get_bit(&rdb->bitmask, (p_index - rdb->window_start)) == 1) 85 89 return err_status_replay_fail; 86 90 … … 99 103 100 104 err_status_t 101 rdb_add_index(rdb_t *rdb, uint32_t index) {105 rdb_add_index(rdb_t *rdb, uint32_t p_index) { 102 106 int delta; 103 107 104 /* here we *assume* that index > rdb->window_start */108 /* here we *assume* that p_index > rdb->window_start */ 105 109 106 delta = ( index - rdb->window_start);110 delta = (p_index - rdb->window_start); 107 111 if (delta < rdb_bits_in_bitmask) { 108 112 109 /* if the index is within the window, set the appropriate bit */113 /* if the p_index is within the window, set the appropriate bit */ 110 114 v128_set_bit(&rdb->bitmask, delta); 111 115
Note: See TracChangeset
for help on using the changeset viewer.