Esempio n. 1
0
 public static function auth($mac, $m, $bytes, $key)
 {
     $p = Poly1305::instance();
     $ctx = $p->init($key);
     $p->update($ctx, $m, $bytes);
     $p->finish($ctx, $mac);
 }
Esempio n. 2
0
File: Salt.php Progetto: rugk/Salt
 public function crypto_onetimeauth($in, $length, $key)
 {
     $mac = new FieldElement(16);
     Poly1305::auth($mac, $in, $length, $key);
     return $mac;
 }