示例#1
0
文件: Poly1305.php 项目: rugk/Salt
 public static function auth($mac, $m, $bytes, $key)
 {
     $p = Poly1305::instance();
     $ctx = $p->init($key);
     $p->update($ctx, $m, $bytes);
     $p->finish($ctx, $mac);
 }
示例#2
0
文件: Salt.php 项目: rugk/Salt
 public function crypto_onetimeauth($in, $length, $key)
 {
     $mac = new FieldElement(16);
     Poly1305::auth($mac, $in, $length, $key);
     return $mac;
 }