Edit File by line
/home/zeestwma/richards.../wp-inclu.../sodium_c.../src/Core
File: Ed25519.php
<?php
[0] Fix | Delete
[1] Fix | Delete
if (class_exists('ParagonIE_Sodium_Core_Ed25519', false)) {
[2] Fix | Delete
return;
[3] Fix | Delete
}
[4] Fix | Delete
if (!class_exists('ParagonIE_Sodium_Core_Curve25519', false)) {
[5] Fix | Delete
require_once dirname(__FILE__) . '/Curve25519.php';
[6] Fix | Delete
}
[7] Fix | Delete
[8] Fix | Delete
/**
[9] Fix | Delete
* Class ParagonIE_Sodium_Core_Ed25519
[10] Fix | Delete
*/
[11] Fix | Delete
abstract class ParagonIE_Sodium_Core_Ed25519 extends ParagonIE_Sodium_Core_Curve25519
[12] Fix | Delete
{
[13] Fix | Delete
const KEYPAIR_BYTES = 96;
[14] Fix | Delete
const SEED_BYTES = 32;
[15] Fix | Delete
const SCALAR_BYTES = 32;
[16] Fix | Delete
[17] Fix | Delete
/**
[18] Fix | Delete
* @internal You should not use this directly from another application
[19] Fix | Delete
*
[20] Fix | Delete
* @return string (96 bytes)
[21] Fix | Delete
* @throws Exception
[22] Fix | Delete
* @throws SodiumException
[23] Fix | Delete
* @throws TypeError
[24] Fix | Delete
*/
[25] Fix | Delete
public static function keypair()
[26] Fix | Delete
{
[27] Fix | Delete
$seed = random_bytes(self::SEED_BYTES);
[28] Fix | Delete
$pk = '';
[29] Fix | Delete
$sk = '';
[30] Fix | Delete
self::seed_keypair($pk, $sk, $seed);
[31] Fix | Delete
return $sk . $pk;
[32] Fix | Delete
}
[33] Fix | Delete
[34] Fix | Delete
/**
[35] Fix | Delete
* @internal You should not use this directly from another application
[36] Fix | Delete
*
[37] Fix | Delete
* @param string $pk
[38] Fix | Delete
* @param string $sk
[39] Fix | Delete
* @param string $seed
[40] Fix | Delete
* @return string
[41] Fix | Delete
* @throws SodiumException
[42] Fix | Delete
* @throws TypeError
[43] Fix | Delete
*/
[44] Fix | Delete
public static function seed_keypair(&$pk, &$sk, $seed)
[45] Fix | Delete
{
[46] Fix | Delete
if (self::strlen($seed) !== self::SEED_BYTES) {
[47] Fix | Delete
throw new SodiumException('crypto_sign keypair seed must be 32 bytes long');
[48] Fix | Delete
}
[49] Fix | Delete
[50] Fix | Delete
/** @var string $pk */
[51] Fix | Delete
$pk = self::publickey_from_secretkey($seed);
[52] Fix | Delete
$sk = $seed . $pk;
[53] Fix | Delete
return $sk;
[54] Fix | Delete
}
[55] Fix | Delete
[56] Fix | Delete
/**
[57] Fix | Delete
* @internal You should not use this directly from another application
[58] Fix | Delete
*
[59] Fix | Delete
* @param string $keypair
[60] Fix | Delete
* @return string
[61] Fix | Delete
* @throws TypeError
[62] Fix | Delete
*/
[63] Fix | Delete
public static function secretkey($keypair)
[64] Fix | Delete
{
[65] Fix | Delete
if (self::strlen($keypair) !== self::KEYPAIR_BYTES) {
[66] Fix | Delete
throw new SodiumException('crypto_sign keypair must be 96 bytes long');
[67] Fix | Delete
}
[68] Fix | Delete
return self::substr($keypair, 0, 64);
[69] Fix | Delete
}
[70] Fix | Delete
[71] Fix | Delete
/**
[72] Fix | Delete
* @internal You should not use this directly from another application
[73] Fix | Delete
*
[74] Fix | Delete
* @param string $keypair
[75] Fix | Delete
* @return string
[76] Fix | Delete
* @throws TypeError
[77] Fix | Delete
*/
[78] Fix | Delete
public static function publickey($keypair)
[79] Fix | Delete
{
[80] Fix | Delete
if (self::strlen($keypair) !== self::KEYPAIR_BYTES) {
[81] Fix | Delete
throw new SodiumException('crypto_sign keypair must be 96 bytes long');
[82] Fix | Delete
}
[83] Fix | Delete
return self::substr($keypair, 64, 32);
[84] Fix | Delete
}
[85] Fix | Delete
[86] Fix | Delete
/**
[87] Fix | Delete
* @internal You should not use this directly from another application
[88] Fix | Delete
*
[89] Fix | Delete
* @param string $sk
[90] Fix | Delete
* @return string
[91] Fix | Delete
* @throws SodiumException
[92] Fix | Delete
* @throws TypeError
[93] Fix | Delete
*/
[94] Fix | Delete
public static function publickey_from_secretkey($sk)
[95] Fix | Delete
{
[96] Fix | Delete
/** @var string $sk */
[97] Fix | Delete
$sk = hash('sha512', self::substr($sk, 0, 32), true);
[98] Fix | Delete
$sk[0] = self::intToChr(
[99] Fix | Delete
self::chrToInt($sk[0]) & 248
[100] Fix | Delete
);
[101] Fix | Delete
$sk[31] = self::intToChr(
[102] Fix | Delete
(self::chrToInt($sk[31]) & 63) | 64
[103] Fix | Delete
);
[104] Fix | Delete
return self::sk_to_pk($sk);
[105] Fix | Delete
}
[106] Fix | Delete
[107] Fix | Delete
/**
[108] Fix | Delete
* Returns TRUE if $A represents a point on the order of the Edwards25519 prime order subgroup.
[109] Fix | Delete
* Returns FALSE if $A is on a different subgroup.
[110] Fix | Delete
*
[111] Fix | Delete
* @param ParagonIE_Sodium_Core_Curve25519_Ge_P3 $A
[112] Fix | Delete
* @return bool
[113] Fix | Delete
*
[114] Fix | Delete
* @throws SodiumException
[115] Fix | Delete
*/
[116] Fix | Delete
public static function is_on_main_subgroup(ParagonIE_Sodium_Core_Curve25519_Ge_P3 $A)
[117] Fix | Delete
{
[118] Fix | Delete
$p1 = self::ge_mul_l($A);
[119] Fix | Delete
$t = self::fe_sub($p1->Y, $p1->Z);
[120] Fix | Delete
return self::fe_isnonzero($p1->X) && self::fe_isnonzero($t);
[121] Fix | Delete
}
[122] Fix | Delete
[123] Fix | Delete
/**
[124] Fix | Delete
* @param string $pk
[125] Fix | Delete
* @return string
[126] Fix | Delete
* @throws SodiumException
[127] Fix | Delete
* @throws TypeError
[128] Fix | Delete
*/
[129] Fix | Delete
public static function pk_to_curve25519($pk)
[130] Fix | Delete
{
[131] Fix | Delete
if (self::small_order($pk)) {
[132] Fix | Delete
throw new SodiumException('Public key is on a small order');
[133] Fix | Delete
}
[134] Fix | Delete
$A = self::ge_frombytes_negate_vartime(self::substr($pk, 0, 32));
[135] Fix | Delete
if (!self::is_on_main_subgroup($A)) {
[136] Fix | Delete
throw new SodiumException('Public key is not on a member of the main subgroup');
[137] Fix | Delete
}
[138] Fix | Delete
[139] Fix | Delete
# fe_1(one_minus_y);
[140] Fix | Delete
# fe_sub(one_minus_y, one_minus_y, A.Y);
[141] Fix | Delete
# fe_invert(one_minus_y, one_minus_y);
[142] Fix | Delete
$one_minux_y = self::fe_invert(
[143] Fix | Delete
self::fe_sub(
[144] Fix | Delete
self::fe_1(),
[145] Fix | Delete
$A->Y
[146] Fix | Delete
)
[147] Fix | Delete
);
[148] Fix | Delete
[149] Fix | Delete
# fe_1(x);
[150] Fix | Delete
# fe_add(x, x, A.Y);
[151] Fix | Delete
# fe_mul(x, x, one_minus_y);
[152] Fix | Delete
$x = self::fe_mul(
[153] Fix | Delete
self::fe_add(self::fe_1(), $A->Y),
[154] Fix | Delete
$one_minux_y
[155] Fix | Delete
);
[156] Fix | Delete
[157] Fix | Delete
# fe_tobytes(curve25519_pk, x);
[158] Fix | Delete
return self::fe_tobytes($x);
[159] Fix | Delete
}
[160] Fix | Delete
[161] Fix | Delete
/**
[162] Fix | Delete
* @internal You should not use this directly from another application
[163] Fix | Delete
*
[164] Fix | Delete
* @param string $sk
[165] Fix | Delete
* @return string
[166] Fix | Delete
* @throws SodiumException
[167] Fix | Delete
* @throws TypeError
[168] Fix | Delete
*/
[169] Fix | Delete
public static function sk_to_pk($sk)
[170] Fix | Delete
{
[171] Fix | Delete
return self::ge_p3_tobytes(
[172] Fix | Delete
self::ge_scalarmult_base(
[173] Fix | Delete
self::substr($sk, 0, 32)
[174] Fix | Delete
)
[175] Fix | Delete
);
[176] Fix | Delete
}
[177] Fix | Delete
[178] Fix | Delete
/**
[179] Fix | Delete
* @internal You should not use this directly from another application
[180] Fix | Delete
*
[181] Fix | Delete
* @param string $message
[182] Fix | Delete
* @param string $sk
[183] Fix | Delete
* @return string
[184] Fix | Delete
* @throws SodiumException
[185] Fix | Delete
* @throws TypeError
[186] Fix | Delete
*/
[187] Fix | Delete
public static function sign($message, $sk)
[188] Fix | Delete
{
[189] Fix | Delete
/** @var string $signature */
[190] Fix | Delete
$signature = self::sign_detached($message, $sk);
[191] Fix | Delete
return $signature . $message;
[192] Fix | Delete
}
[193] Fix | Delete
[194] Fix | Delete
/**
[195] Fix | Delete
* @internal You should not use this directly from another application
[196] Fix | Delete
*
[197] Fix | Delete
* @param string $message A signed message
[198] Fix | Delete
* @param string $pk Public key
[199] Fix | Delete
* @return string Message (without signature)
[200] Fix | Delete
* @throws SodiumException
[201] Fix | Delete
* @throws TypeError
[202] Fix | Delete
*/
[203] Fix | Delete
public static function sign_open($message, $pk)
[204] Fix | Delete
{
[205] Fix | Delete
/** @var string $signature */
[206] Fix | Delete
$signature = self::substr($message, 0, 64);
[207] Fix | Delete
[208] Fix | Delete
/** @var string $message */
[209] Fix | Delete
$message = self::substr($message, 64);
[210] Fix | Delete
[211] Fix | Delete
if (self::verify_detached($signature, $message, $pk)) {
[212] Fix | Delete
return $message;
[213] Fix | Delete
}
[214] Fix | Delete
throw new SodiumException('Invalid signature');
[215] Fix | Delete
}
[216] Fix | Delete
[217] Fix | Delete
/**
[218] Fix | Delete
* @internal You should not use this directly from another application
[219] Fix | Delete
*
[220] Fix | Delete
* @param string $message
[221] Fix | Delete
* @param string $sk
[222] Fix | Delete
* @return string
[223] Fix | Delete
* @throws SodiumException
[224] Fix | Delete
* @throws TypeError
[225] Fix | Delete
*/
[226] Fix | Delete
public static function sign_detached($message, $sk)
[227] Fix | Delete
{
[228] Fix | Delete
if (self::strlen($sk) !== 64) {
[229] Fix | Delete
throw new SodiumException('Argument 2 must be CRYPTO_SIGN_SECRETKEYBYTES long');
[230] Fix | Delete
}
[231] Fix | Delete
# crypto_hash_sha512(az, sk, 32);
[232] Fix | Delete
$az = hash('sha512', self::substr($sk, 0, 32), true);
[233] Fix | Delete
[234] Fix | Delete
# az[0] &= 248;
[235] Fix | Delete
# az[31] &= 63;
[236] Fix | Delete
# az[31] |= 64;
[237] Fix | Delete
$az[0] = self::intToChr(self::chrToInt($az[0]) & 248);
[238] Fix | Delete
$az[31] = self::intToChr((self::chrToInt($az[31]) & 63) | 64);
[239] Fix | Delete
[240] Fix | Delete
# crypto_hash_sha512_init(&hs);
[241] Fix | Delete
# crypto_hash_sha512_update(&hs, az + 32, 32);
[242] Fix | Delete
# crypto_hash_sha512_update(&hs, m, mlen);
[243] Fix | Delete
# crypto_hash_sha512_final(&hs, nonce);
[244] Fix | Delete
$hs = hash_init('sha512');
[245] Fix | Delete
hash_update($hs, self::substr($az, 32, 32));
[246] Fix | Delete
hash_update($hs, $message);
[247] Fix | Delete
$nonceHash = hash_final($hs, true);
[248] Fix | Delete
[249] Fix | Delete
# memmove(sig + 32, sk + 32, 32);
[250] Fix | Delete
$pk = self::substr($sk, 32, 32);
[251] Fix | Delete
[252] Fix | Delete
# sc_reduce(nonce);
[253] Fix | Delete
# ge_scalarmult_base(&R, nonce);
[254] Fix | Delete
# ge_p3_tobytes(sig, &R);
[255] Fix | Delete
$nonce = self::sc_reduce($nonceHash) . self::substr($nonceHash, 32);
[256] Fix | Delete
$sig = self::ge_p3_tobytes(
[257] Fix | Delete
self::ge_scalarmult_base($nonce)
[258] Fix | Delete
);
[259] Fix | Delete
[260] Fix | Delete
# crypto_hash_sha512_init(&hs);
[261] Fix | Delete
# crypto_hash_sha512_update(&hs, sig, 64);
[262] Fix | Delete
# crypto_hash_sha512_update(&hs, m, mlen);
[263] Fix | Delete
# crypto_hash_sha512_final(&hs, hram);
[264] Fix | Delete
$hs = hash_init('sha512');
[265] Fix | Delete
hash_update($hs, self::substr($sig, 0, 32));
[266] Fix | Delete
hash_update($hs, self::substr($pk, 0, 32));
[267] Fix | Delete
hash_update($hs, $message);
[268] Fix | Delete
$hramHash = hash_final($hs, true);
[269] Fix | Delete
[270] Fix | Delete
# sc_reduce(hram);
[271] Fix | Delete
# sc_muladd(sig + 32, hram, az, nonce);
[272] Fix | Delete
$hram = self::sc_reduce($hramHash);
[273] Fix | Delete
$sigAfter = self::sc_muladd($hram, $az, $nonce);
[274] Fix | Delete
$sig = self::substr($sig, 0, 32) . self::substr($sigAfter, 0, 32);
[275] Fix | Delete
[276] Fix | Delete
try {
[277] Fix | Delete
ParagonIE_Sodium_Compat::memzero($az);
[278] Fix | Delete
} catch (SodiumException $ex) {
[279] Fix | Delete
$az = null;
[280] Fix | Delete
}
[281] Fix | Delete
return $sig;
[282] Fix | Delete
}
[283] Fix | Delete
[284] Fix | Delete
/**
[285] Fix | Delete
* @internal You should not use this directly from another application
[286] Fix | Delete
*
[287] Fix | Delete
* @param string $sig
[288] Fix | Delete
* @param string $message
[289] Fix | Delete
* @param string $pk
[290] Fix | Delete
* @return bool
[291] Fix | Delete
* @throws SodiumException
[292] Fix | Delete
* @throws TypeError
[293] Fix | Delete
*/
[294] Fix | Delete
public static function verify_detached($sig, $message, $pk)
[295] Fix | Delete
{
[296] Fix | Delete
if (self::strlen($sig) !== 64) {
[297] Fix | Delete
throw new SodiumException('Argument 1 must be CRYPTO_SIGN_BYTES long');
[298] Fix | Delete
}
[299] Fix | Delete
if (self::strlen($pk) !== 32) {
[300] Fix | Delete
throw new SodiumException('Argument 3 must be CRYPTO_SIGN_PUBLICKEYBYTES long');
[301] Fix | Delete
}
[302] Fix | Delete
if ((self::chrToInt($sig[63]) & 240) && self::check_S_lt_L(self::substr($sig, 32, 32))) {
[303] Fix | Delete
throw new SodiumException('S >= L - Invalid signature');
[304] Fix | Delete
}
[305] Fix | Delete
if (self::small_order($sig)) {
[306] Fix | Delete
throw new SodiumException('Signature is on too small of an order');
[307] Fix | Delete
}
[308] Fix | Delete
if ((self::chrToInt($sig[63]) & 224) !== 0) {
[309] Fix | Delete
throw new SodiumException('Invalid signature');
[310] Fix | Delete
}
[311] Fix | Delete
$d = 0;
[312] Fix | Delete
for ($i = 0; $i < 32; ++$i) {
[313] Fix | Delete
$d |= self::chrToInt($pk[$i]);
[314] Fix | Delete
}
[315] Fix | Delete
if ($d === 0) {
[316] Fix | Delete
throw new SodiumException('All zero public key');
[317] Fix | Delete
}
[318] Fix | Delete
[319] Fix | Delete
/** @var bool The original value of ParagonIE_Sodium_Compat::$fastMult */
[320] Fix | Delete
$orig = ParagonIE_Sodium_Compat::$fastMult;
[321] Fix | Delete
[322] Fix | Delete
// Set ParagonIE_Sodium_Compat::$fastMult to true to speed up verification.
[323] Fix | Delete
ParagonIE_Sodium_Compat::$fastMult = true;
[324] Fix | Delete
[325] Fix | Delete
/** @var ParagonIE_Sodium_Core_Curve25519_Ge_P3 $A */
[326] Fix | Delete
$A = self::ge_frombytes_negate_vartime($pk);
[327] Fix | Delete
if (!self::is_on_main_subgroup($A)) {
[328] Fix | Delete
throw new SodiumException('Public key is not on a member of the main subgroup');
[329] Fix | Delete
}
[330] Fix | Delete
[331] Fix | Delete
/** @var string $hDigest */
[332] Fix | Delete
$hDigest = hash(
[333] Fix | Delete
'sha512',
[334] Fix | Delete
self::substr($sig, 0, 32) .
[335] Fix | Delete
self::substr($pk, 0, 32) .
[336] Fix | Delete
$message,
[337] Fix | Delete
true
[338] Fix | Delete
);
[339] Fix | Delete
[340] Fix | Delete
/** @var string $h */
[341] Fix | Delete
$h = self::sc_reduce($hDigest) . self::substr($hDigest, 32);
[342] Fix | Delete
[343] Fix | Delete
/** @var ParagonIE_Sodium_Core_Curve25519_Ge_P2 $R */
[344] Fix | Delete
$R = self::ge_double_scalarmult_vartime(
[345] Fix | Delete
$h,
[346] Fix | Delete
$A,
[347] Fix | Delete
self::substr($sig, 32)
[348] Fix | Delete
);
[349] Fix | Delete
[350] Fix | Delete
/** @var string $rcheck */
[351] Fix | Delete
$rcheck = self::ge_tobytes($R);
[352] Fix | Delete
[353] Fix | Delete
// Reset ParagonIE_Sodium_Compat::$fastMult to what it was before.
[354] Fix | Delete
ParagonIE_Sodium_Compat::$fastMult = $orig;
[355] Fix | Delete
[356] Fix | Delete
return self::verify_32($rcheck, self::substr($sig, 0, 32));
[357] Fix | Delete
}
[358] Fix | Delete
[359] Fix | Delete
/**
[360] Fix | Delete
* @internal You should not use this directly from another application
[361] Fix | Delete
*
[362] Fix | Delete
* @param string $S
[363] Fix | Delete
* @return bool
[364] Fix | Delete
* @throws SodiumException
[365] Fix | Delete
* @throws TypeError
[366] Fix | Delete
*/
[367] Fix | Delete
public static function check_S_lt_L($S)
[368] Fix | Delete
{
[369] Fix | Delete
if (self::strlen($S) < 32) {
[370] Fix | Delete
throw new SodiumException('Signature must be 32 bytes');
[371] Fix | Delete
}
[372] Fix | Delete
$L = array(
[373] Fix | Delete
0xed, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58,
[374] Fix | Delete
0xd6, 0x9c, 0xf7, 0xa2, 0xde, 0xf9, 0xde, 0x14,
[375] Fix | Delete
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
[376] Fix | Delete
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10
[377] Fix | Delete
);
[378] Fix | Delete
$c = 0;
[379] Fix | Delete
$n = 1;
[380] Fix | Delete
$i = 32;
[381] Fix | Delete
[382] Fix | Delete
/** @var array<int, int> $L */
[383] Fix | Delete
do {
[384] Fix | Delete
--$i;
[385] Fix | Delete
$x = self::chrToInt($S[$i]);
[386] Fix | Delete
$c |= (
[387] Fix | Delete
(($x - $L[$i]) >> 8) & $n
[388] Fix | Delete
);
[389] Fix | Delete
$n &= (
[390] Fix | Delete
(($x ^ $L[$i]) - 1) >> 8
[391] Fix | Delete
);
[392] Fix | Delete
} while ($i !== 0);
[393] Fix | Delete
[394] Fix | Delete
return $c === 0;
[395] Fix | Delete
}
[396] Fix | Delete
[397] Fix | Delete
/**
[398] Fix | Delete
* @param string $R
[399] Fix | Delete
* @return bool
[400] Fix | Delete
* @throws SodiumException
[401] Fix | Delete
* @throws TypeError
[402] Fix | Delete
*/
[403] Fix | Delete
public static function small_order($R)
[404] Fix | Delete
{
[405] Fix | Delete
/** @var array<int, array<int, int>> $blocklist */
[406] Fix | Delete
$blocklist = array(
[407] Fix | Delete
/* 0 (order 4) */
[408] Fix | Delete
array(
[409] Fix | Delete
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
[410] Fix | Delete
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
[411] Fix | Delete
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
[412] Fix | Delete
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
[413] Fix | Delete
),
[414] Fix | Delete
/* 1 (order 1) */
[415] Fix | Delete
array(
[416] Fix | Delete
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
[417] Fix | Delete
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
[418] Fix | Delete
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
[419] Fix | Delete
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
[420] Fix | Delete
),
[421] Fix | Delete
/* 2707385501144840649318225287225658788936804267575313519463743609750303402022 (order 8) */
[422] Fix | Delete
array(
[423] Fix | Delete
0x26, 0xe8, 0x95, 0x8f, 0xc2, 0xb2, 0x27, 0xb0,
[424] Fix | Delete
0x45, 0xc3, 0xf4, 0x89, 0xf2, 0xef, 0x98, 0xf0,
[425] Fix | Delete
0xd5, 0xdf, 0xac, 0x05, 0xd3, 0xc6, 0x33, 0x39,
[426] Fix | Delete
0xb1, 0x38, 0x02, 0x88, 0x6d, 0x53, 0xfc, 0x05
[427] Fix | Delete
),
[428] Fix | Delete
/* 55188659117513257062467267217118295137698188065244968500265048394206261417927 (order 8) */
[429] Fix | Delete
array(
[430] Fix | Delete
0xc7, 0x17, 0x6a, 0x70, 0x3d, 0x4d, 0xd8, 0x4f,
[431] Fix | Delete
0xba, 0x3c, 0x0b, 0x76, 0x0d, 0x10, 0x67, 0x0f,
[432] Fix | Delete
0x2a, 0x20, 0x53, 0xfa, 0x2c, 0x39, 0xcc, 0xc6,
[433] Fix | Delete
0x4e, 0xc7, 0xfd, 0x77, 0x92, 0xac, 0x03, 0x7a
[434] Fix | Delete
),
[435] Fix | Delete
/* p-1 (order 2) */
[436] Fix | Delete
array(
[437] Fix | Delete
0x13, 0xe8, 0x95, 0x8f, 0xc2, 0xb2, 0x27, 0xb0,
[438] Fix | Delete
0x45, 0xc3, 0xf4, 0x89, 0xf2, 0xef, 0x98, 0xf0,
[439] Fix | Delete
0xd5, 0xdf, 0xac, 0x05, 0xd3, 0xc6, 0x33, 0x39,
[440] Fix | Delete
0xb1, 0x38, 0x02, 0x88, 0x6d, 0x53, 0xfc, 0x85
[441] Fix | Delete
),
[442] Fix | Delete
/* p (order 4) */
[443] Fix | Delete
array(
[444] Fix | Delete
0xb4, 0x17, 0x6a, 0x70, 0x3d, 0x4d, 0xd8, 0x4f,
[445] Fix | Delete
0xba, 0x3c, 0x0b, 0x76, 0x0d, 0x10, 0x67, 0x0f,
[446] Fix | Delete
0x2a, 0x20, 0x53, 0xfa, 0x2c, 0x39, 0xcc, 0xc6,
[447] Fix | Delete
0x4e, 0xc7, 0xfd, 0x77, 0x92, 0xac, 0x03, 0xfa
[448] Fix | Delete
),
[449] Fix | Delete
/* p+1 (order 1) */
[450] Fix | Delete
array(
[451] Fix | Delete
0xec, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
[452] Fix | Delete
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
[453] Fix | Delete
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
[454] Fix | Delete
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f
[455] Fix | Delete
),
[456] Fix | Delete
/* p+2707385501144840649318225287225658788936804267575313519463743609750303402022 (order 8) */
[457] Fix | Delete
array(
[458] Fix | Delete
0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
[459] Fix | Delete
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
[460] Fix | Delete
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
[461] Fix | Delete
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f
[462] Fix | Delete
),
[463] Fix | Delete
/* p+55188659117513257062467267217118295137698188065244968500265048394206261417927 (order 8) */
[464] Fix | Delete
array(
[465] Fix | Delete
0xee, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
[466] Fix | Delete
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
[467] Fix | Delete
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
[468] Fix | Delete
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f
[469] Fix | Delete
),
[470] Fix | Delete
/* 2p-1 (order 2) */
[471] Fix | Delete
array(
[472] Fix | Delete
0xd9, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
[473] Fix | Delete
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
[474] Fix | Delete
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
[475] Fix | Delete
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
[476] Fix | Delete
),
[477] Fix | Delete
/* 2p (order 4) */
[478] Fix | Delete
array(
[479] Fix | Delete
0xda, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
[480] Fix | Delete
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
[481] Fix | Delete
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
[482] Fix | Delete
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
[483] Fix | Delete
),
[484] Fix | Delete
/* 2p+1 (order 1) */
[485] Fix | Delete
array(
[486] Fix | Delete
0xdb, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
[487] Fix | Delete
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
[488] Fix | Delete
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
[489] Fix | Delete
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
[490] Fix | Delete
)
[491] Fix | Delete
);
[492] Fix | Delete
/** @var int $countBlocklist */
[493] Fix | Delete
$countBlocklist = count($blocklist);
[494] Fix | Delete
[495] Fix | Delete
for ($i = 0; $i < $countBlocklist; ++$i) {
[496] Fix | Delete
$c = 0;
[497] Fix | Delete
for ($j = 0; $j < 32; ++$j) {
[498] Fix | Delete
$c |= self::chrToInt($R[$j]) ^ (int) $blocklist[$i][$j];
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function