wp/wp-includes/sodium_compat/src/Core32/XChaCha20.php
changeset 19 3d72ae0968f4
parent 9 177826044cd9
equal deleted inserted replaced
18:be944660c56a 19:3d72ae0968f4
    59                 $ic
    59                 $ic
    60             ),
    60             ),
    61             $message
    61             $message
    62         );
    62         );
    63     }
    63     }
       
    64 
       
    65     /**
       
    66      * @internal You should not use this directly from another application
       
    67      *
       
    68      * @param string $message
       
    69      * @param string $nonce
       
    70      * @param string $key
       
    71      * @param string $ic
       
    72      * @return string
       
    73      * @throws SodiumException
       
    74      * @throws TypeError
       
    75      */
       
    76     public static function ietfStreamXorIc($message, $nonce = '', $key = '', $ic = '')
       
    77     {
       
    78         return self::encryptBytes(
       
    79             new ParagonIE_Sodium_Core32_ChaCha20_IetfCtx(
       
    80                 self::hChaCha20(self::substr($nonce, 0, 16), $key),
       
    81                 "\x00\x00\x00\x00" . self::substr($nonce, 16, 8),
       
    82                 $ic
       
    83             ),
       
    84             $message
       
    85         );
       
    86     }
    64 }
    87 }