ParagonIE_Sodium_Compat::crypto_generichash_update

Advertisement

Summery Summery

Update a BLAKE2b hashing context with additional data.

Syntax Syntax

ParagonIE_Sodium_Compat::crypto_generichash_update( string $ctx, string $message )

Parameters Parameters

$ctx

(Required) BLAKE2 hashing context. Generated by crypto_generichash_init(). $ctx is passed by reference and gets updated in-place.

$message

(Required) The message to append to the existing hash state.

Return Return

(void)

Source Source

File: wp-includes/sodium_compat/src/Compat.php

    public static function crypto_generichash_update(&$ctx, $message)
    {
        /* Type checks: */
        ParagonIE_Sodium_Core_Util::declareScalarType($ctx, 'string', 1);
        ParagonIE_Sodium_Core_Util::declareScalarType($message, 'string', 2);

        if (self::useNewSodiumAPI()) {
            sodium_crypto_generichash_update($ctx, $message);
            return;
        }
        if (self::use_fallback('crypto_generichash_update')) {
            $func = '\\Sodium\\crypto_generichash_update';
            $func($ctx, $message);
            return;
        }
        if (PHP_INT_SIZE === 4) {
            $ctx = ParagonIE_Sodium_Crypto32::generichash_update($ctx, $message);
        } else {
            $ctx = ParagonIE_Sodium_Crypto::generichash_update($ctx, $message);
        }
    }

Advertisement

Advertisement

Leave a Reply