コード例 #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;
 }