import { Poly1305 } from '../dist/salty-crypto.mjs'; import { it, expect } from 'vitest'; it('section 2.5.2 from rfc 8439', () => { const key = Uint8Array.from([ 0x85, 0xd6, 0xbe, 0x78, 0x57, 0x55, 0x6d, 0x33, 0x7f, 0x44, 0x52, 0xfe, 0x42, 0xd5, 0x06, 0xa8, 0x01, 0x03, 0x80, 0x8a, 0xfb, 0x0d, 0xb2, 0xfd, 0x4a, 0xbf, 0xf6, 0xaf, 0x41, 0x49, 0xf5, 0x1b, ]); const message = new TextEncoder().encode("Cryptographic Forum Research Group"); expect(Poly1305.digest(message, key)).toEqual(Uint8Array.from([ 0xa8, 0x06, 0x1d, 0xc1, 0x30, 0x51, 0x36, 0xc6, 0xc2, 0x2b, 0x8b, 0xaf, 0x0c, 0x01, 0x27, 0xa9, ])); });