public static function auth($mac, $m, $bytes, $key) { $p = Poly1305::instance(); $ctx = $p->init($key); $p->update($ctx, $m, $bytes); $p->finish($ctx, $mac); }
public function crypto_onetimeauth($in, $length, $key) { $mac = new FieldElement(16); Poly1305::auth($mac, $in, $length, $key); return $mac; }