bitwiseshiftleft/sjcl — pull request #146 by stbuehler (2014-01-02 15:13:40+00:00)
Title: Poly1305(-AES)

Poly1305 is a MAC designed by D. J. Bernstein, and is used together with ChaCha20 in https://tools.ietf.org/id/draft-agl-tls-chacha20poly1305-04.html

See http://cr.yp.to/mac.html for motivation and details :)

Similar to #144 the byteswap function could be refactored.

Just one question:
```
// Bernstein's prime for Curve25519
p25519: sbp(255, [[0,-19]]),
```
All other "sbp"s use only -1 or +1 as coefficients, so `[[0,-19]]` should actually be `[[4,-1],[1,-1],[0,-1]]` - unless ofc the implementation handles this well, then `p1305` could be defined as `sbp(130, [[0,-5]])`.