Lines Matching refs:m

523      * @param string $m string of length less than 2^67 bits.
527 private function uhash($m, $taglen) argument
555 $a = self::L1Hash($L1Key_i, $m);
556 $b = strlen($m) <= 1024 ? "\0\0\0\0\0\0\0\0$a" : self::L2Hash($L2Key_i, $a);
572 * @param string $m string of length less than 2^67 bits.
575 private static function L1Hash($k, $m) argument
580 $m = str_split($m, 1024);
588 for ($i = 0; $i < count($m) - 1; $i++) {
589 $m[$i] = pack('N*', ...unpack('V*', $m[$i])); // ENDIAN-SWAP
590 $y .= static::nh($k, $m[$i], $length);
597 $length = strlen($m[$i]);
600 $m[$i] = str_pad($m[$i], $pad, "\0"); // zeropad
601 $m[$i] = pack('N*', ...unpack('V*', $m[$i])); // ENDIAN-SWAP
603 $y .= static::nh($k, $m[$i], new BigInteger($length * 8));
612 * @param string $m string with length divisible by 32 bytes.
615 private static function nh($k, $m, $length) argument
627 $m = str_split($m, 4);
628 $t = count($m);
632 $m = array_map($toUInt32, $m);
643 $temp = $m[$i]->add($k[$i]);
645 $temp = $temp->multiply($m[$i + 4]->add($k[$i + 4]));
648 $temp = $m[$i + 1]->add($k[$i + 1]);
650 $temp = $temp->multiply($m[$i + 5]->add($k[$i + 5]));
653 $temp = $m[$i + 2]->add($k[$i + 2]);
655 $temp = $temp->multiply($m[$i + 6]->add($k[$i + 6]));
658 $temp = $m[$i + 3]->add($k[$i + 3]);
660 $temp = $temp->multiply($m[$i + 7]->add($k[$i + 7]));
681 * @param string $m string of length less than 2^64 bytes.
684 private static function L2Hash($k, $m) argument
699 if (strlen($m) <= 0x20000) { // 2^14 64-bit words
700 $y = self::poly(64, self::$maxwordrange64, $k64, $m);
702 $m_1 = substr($m, 0, 0x20000); // 1 << 17
703 $m_2 = substr($m, 0x20000) . "\x80";
722 * @param string $m string with length divisible by (wordbits / 8) bytes.
725 private static function poly($wordbits, $maxwordrange, $k, $m) argument
746 $m_i = str_split($m, $wordbytes);
753 foreach ($m_i as $m) {
754 $m = $factory->newInteger(new BigInteger($m, 256));
755 if ($m->compare($maxwordrange) >= 0) {
757 $y = $k->multiply($y)->add($m->subtract($offset));
759 $y = $k->multiply($y)->add($m);
774 * @param string $m string of length 16 bytes.
777 private static function L3Hash($k1, $k2, $m) argument
783 $m_i = $factory->newInteger(new BigInteger(substr($m, 2 * $i, 2), 256));
1325 * @param string $m
1329 private static function sha512($m, $hash) argument
1365 $length = strlen($m);
1367 $m .= str_repeat(chr(0), 128 - (($length + 16) & 0x7F));
1368 $m[$length] = chr(0x80);
1370 $m .= pack('N4', 0, 0, 0, $length << 3);
1373 $chunks = str_split($m, 128);