Loading files
8035964e1This file is pinned to the selected release. Download the original to open it in your design tool.
Files from this revision, including CAD and LFS contents. Git history is not included.
Or in GitHub Desktop, choose File → Clone repository → URL and paste this address.
Public repositories can be cloned without signing in. For pushing, use your ThingAtlas username and a Git access token as the password.
git lfs install git clone https://thingatlas.com/git/-unclaimed/openharness-1322671404.git
Includes Git history, branches, and Git LFS files. Clones the repository’s default branch, regardless of the version shown here.
import { describe, expect, it } from 'vitest'
import { E2EE_REPLAY_WINDOW_SIZE, ReplayWindow } from './replayWindow.js'
describe('E2EE replay window', () => {
it('accepts authentic counters arriving out of order once, then rejects replays', () => {
const window = new ReplayWindow()
expect(window.allows(2)).toBe(true)
window.commit(2)
expect(window.allows(0)).toBe(true)
window.commit(0)
expect(window.allows(1)).toBe(true)
window.commit(1)
expect(window.allows(0)).toBe(false)
expect(window.allows(2)).toBe(false)
})
it('rejects counters older than the bounded transport-reordering window', () => {
const window = new ReplayWindow()
window.commit(E2EE_REPLAY_WINDOW_SIZE + 7)
expect(window.allows(7)).toBe(false)
expect(window.allows(8)).toBe(true)
})
})
8035964e1This file is pinned to the selected release. Download the original to open it in your design tool.