Lines Matching refs:diff
124 u32 diff; in xfrm_replay_check_legacy() local
136 diff = x->replay.seq - seq; in xfrm_replay_check_legacy()
137 if (diff >= x->props.replay_window) { in xfrm_replay_check_legacy()
142 if (x->replay.bitmap & (1U << diff)) { in xfrm_replay_check_legacy()
158 u32 diff, seq; in xfrm_replay_advance() local
174 diff = seq - x->replay.seq; in xfrm_replay_advance()
175 if (diff < x->props.replay_window) in xfrm_replay_advance()
176 x->replay.bitmap = ((x->replay.bitmap) << diff) | 1; in xfrm_replay_advance()
181 diff = x->replay.seq - seq; in xfrm_replay_advance()
182 x->replay.bitmap |= (1U << diff); in xfrm_replay_advance()
220 u32 diff = replay_esn->seq - seq; in xfrm_replay_check_bmp() local
231 if (diff >= replay_esn->replay_window) { in xfrm_replay_check_bmp()
238 if (pos >= diff) in xfrm_replay_check_bmp()
239 bitnr = (pos - diff) % replay_esn->replay_window; in xfrm_replay_check_bmp()
241 bitnr = replay_esn->replay_window - (diff - pos); in xfrm_replay_check_bmp()
260 u32 diff; in xfrm_replay_advance_bmp() local
271 diff = seq - replay_esn->seq; in xfrm_replay_advance_bmp()
273 if (diff < replay_esn->replay_window) { in xfrm_replay_advance_bmp()
274 for (i = 1; i < diff; i++) { in xfrm_replay_advance_bmp()
286 bitnr = (pos + diff) % replay_esn->replay_window; in xfrm_replay_advance_bmp()
289 diff = replay_esn->seq - seq; in xfrm_replay_advance_bmp()
291 if (pos >= diff) in xfrm_replay_advance_bmp()
292 bitnr = (pos - diff) % replay_esn->replay_window; in xfrm_replay_advance_bmp()
294 bitnr = replay_esn->replay_window - (diff - pos); in xfrm_replay_advance_bmp()
455 u32 diff; in xfrm_replay_check_esn() local
470 diff = top - seq; in xfrm_replay_check_esn()
481 diff = ~seq + top + 1; in xfrm_replay_check_esn()
484 if (diff >= replay_esn->replay_window) { in xfrm_replay_check_esn()
491 if (pos >= diff) in xfrm_replay_check_esn()
492 bitnr = (pos - diff) % replay_esn->replay_window; in xfrm_replay_check_esn()
494 bitnr = replay_esn->replay_window - (diff - pos); in xfrm_replay_check_esn()
557 u32 diff, pos, seq, seq_hi; in xfrm_replay_advance_esn() local
570 diff = seq - replay_esn->seq; in xfrm_replay_advance_esn()
572 diff = ~replay_esn->seq + seq + 1; in xfrm_replay_advance_esn()
574 if (diff < replay_esn->replay_window) { in xfrm_replay_advance_esn()
575 for (i = 1; i < diff; i++) { in xfrm_replay_advance_esn()
587 bitnr = (pos + diff) % replay_esn->replay_window; in xfrm_replay_advance_esn()
593 diff = replay_esn->seq - seq; in xfrm_replay_advance_esn()
595 if (pos >= diff) in xfrm_replay_advance_esn()
596 bitnr = (pos - diff) % replay_esn->replay_window; in xfrm_replay_advance_esn()
598 bitnr = replay_esn->replay_window - (diff - pos); in xfrm_replay_advance_esn()