You are here

public static function ParagonIE_Sodium_Crypto32::generichash_update in Automatic Updates 8

Same name and namespace in other branches
  1. 7 vendor/paragonie/sodium_compat/src/Crypto32.php \ParagonIE_Sodium_Crypto32::generichash_update()

Update a hashing context for BLAKE2b with $message

@internal Do not use this directly. Use ParagonIE_Sodium_Compat.

Parameters

string $ctx:

string $message:

Return value

string

Throws

SodiumException

TypeError

1 call to ParagonIE_Sodium_Crypto32::generichash_update()
ParagonIE_Sodium_Compat::crypto_generichash_update in vendor/paragonie/sodium_compat/src/Compat.php
Update a BLAKE2b hashing context with additional data.

File

vendor/paragonie/sodium_compat/src/Crypto32.php, line 837

Class

ParagonIE_Sodium_Crypto32
Class ParagonIE_Sodium_Crypto

Code

public static function generichash_update($ctx, $message) {

  // This ensures that ParagonIE_Sodium_Core32_BLAKE2b::$iv is initialized
  ParagonIE_Sodium_Core32_BLAKE2b::pseudoConstructor();

  /** @var SplFixedArray $context */
  $context = ParagonIE_Sodium_Core32_BLAKE2b::stringToContext($ctx);

  /** @var SplFixedArray $in */
  $in = ParagonIE_Sodium_Core32_BLAKE2b::stringToSplFixedArray($message);
  ParagonIE_Sodium_Core32_BLAKE2b::update($context, $in, $in
    ->count());
  return ParagonIE_Sodium_Core32_BLAKE2b::contextToString($context);
}