Skip to content

Commit

Permalink
Add test for gh-2
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmillr committed Jul 15, 2023
1 parent 9be5219 commit eabdd62
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/basic.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,16 @@ should('tweetnacl secretbox compat', () => {
}
});

should('handle byte offsets correctly', () => {
const sample = new Uint8Array(60).fill(1);
const data = new Uint8Array(sample.buffer, 1);
const key = new Uint8Array(32).fill(2);
const nonce12 = new Uint8Array(12).fill(3);
const stream_c = chacha20_poly1305(key, nonce12);
const encrypted_c = stream_c.encrypt(data);
stream_c.decrypt(encrypted_c); // === data
});

describe('Wycheproof', () => {
const t = (name, vectors, cipher) => {
should(name, () => {
Expand Down

0 comments on commit eabdd62

Please sign in to comment.