WordPress.org

Make WordPress Core


Ignore:
Timestamp:
05/17/2019 10:57:19 AM (19 months ago)
Author:
tellyworth
Message:

Upgrade/Install: Update sodium_compat to v1.10.0.

This adds a runtime_speed_test() method for estimating if the 32-bit implementation is fast enough for expensive computations.

Props paragoninitiativeenterprises.
See #47186.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/sodium_compat/src/Core32/X25519.php

    r44953 r45344  
    103103    public static function fe_mul121666(ParagonIE_Sodium_Core32_Curve25519_Fe $f)
    104104    {
    105         /** @var array<int, ParagonIE_Sodium_Core32_Int32> $h */
     105        /** @var array<int, ParagonIE_Sodium_Core32_Int64> $h */
    106106        $h = array();
    107107        for ($i = 0; $i < 10; ++$i) {
     
    109109        }
    110110
    111         /** @var ParagonIE_Sodium_Core32_Int32 $carry9 */
    112111        $carry9 = $h[9]->addInt(1 << 24)->shiftRight(25);
    113112        $h[0] = $h[0]->addInt64($carry9->mulInt(19, 5));
    114113        $h[9] = $h[9]->subInt64($carry9->shiftLeft(25));
    115114
    116         /** @var ParagonIE_Sodium_Core32_Int32 $carry1 */
    117115        $carry1 = $h[1]->addInt(1 << 24)->shiftRight(25);
    118116        $h[2] = $h[2]->addInt64($carry1);
    119117        $h[1] = $h[1]->subInt64($carry1->shiftLeft(25));
    120118
    121         /** @var ParagonIE_Sodium_Core32_Int32 $carry3 */
    122119        $carry3 = $h[3]->addInt(1 << 24)->shiftRight(25);
    123120        $h[4] = $h[4]->addInt64($carry3);
    124121        $h[3] = $h[3]->subInt64($carry3->shiftLeft(25));
    125122
    126         /** @var ParagonIE_Sodium_Core32_Int32 $carry5 */
    127123        $carry5 = $h[5]->addInt(1 << 24)->shiftRight(25);
    128124        $h[6] = $h[6]->addInt64($carry5);
    129125        $h[5] = $h[5]->subInt64($carry5->shiftLeft(25));
    130126
    131         /** @var ParagonIE_Sodium_Core32_Int32 $carry7 */
    132127        $carry7 = $h[7]->addInt(1 << 24)->shiftRight(25);
    133128        $h[8] = $h[8]->addInt64($carry7);
    134129        $h[7] = $h[7]->subInt64($carry7->shiftLeft(25));
    135130
    136         /** @var ParagonIE_Sodium_Core32_Int32 $carry0 */
    137131        $carry0 = $h[0]->addInt(1 << 25)->shiftRight(26);
    138132        $h[1] = $h[1]->addInt64($carry0);
    139133        $h[0] = $h[0]->subInt64($carry0->shiftLeft(26));
    140134
    141         /** @var ParagonIE_Sodium_Core32_Int32 $carry2 */
    142135        $carry2 = $h[2]->addInt(1 << 25)->shiftRight(26);
    143136        $h[3] = $h[3]->addInt64($carry2);
    144137        $h[2] = $h[2]->subInt64($carry2->shiftLeft(26));
    145138
    146         /** @var ParagonIE_Sodium_Core32_Int32 $carry4 */
    147139        $carry4 = $h[4]->addInt(1 << 25)->shiftRight(26);
    148140        $h[5] = $h[5]->addInt64($carry4);
    149141        $h[4] = $h[4]->subInt64($carry4->shiftLeft(26));
    150142
    151         /** @var ParagonIE_Sodium_Core32_Int32 $carry6 */
    152143        $carry6 = $h[6]->addInt(1 << 25)->shiftRight(26);
    153144        $h[7] = $h[7]->addInt64($carry6);
    154145        $h[6] = $h[6]->subInt64($carry6->shiftLeft(26));
    155146
    156         /** @var ParagonIE_Sodium_Core32_Int32 $carry8 */
    157147        $carry8 = $h[8]->addInt(1 << 25)->shiftRight(26);
    158148        $h[9] = $h[9]->addInt64($carry8);
Note: See TracChangeset for help on using the changeset viewer.