Code Duplication    Length = 15-15 lines in 2 locations

src/library/sodium_compat/src/Crypto.php 1 location

@@ 747-761 (lines=15) @@
744
     * @param string $message
745
     * @return string
746
     */
747
    public static function generichash_update($ctx, $message)
748
    {
749
        // This ensures that ParagonIE_Sodium_Core_BLAKE2b::$iv is initialized
750
        ParagonIE_Sodium_Core_BLAKE2b::pseudoConstructor();
751
752
        /** @var SplFixedArray $context */
753
        $context = ParagonIE_Sodium_Core_BLAKE2b::stringToContext($ctx);
754
755
        /** @var SplFixedArray $in */
756
        $in = ParagonIE_Sodium_Core_BLAKE2b::stringToSplFixedArray($message);
757
758
        ParagonIE_Sodium_Core_BLAKE2b::update($context, $in, $in->count());
759
760
        return ParagonIE_Sodium_Core_BLAKE2b::contextToString($context);
761
    }
762
763
    /**
764
     * Libsodium's crypto_kx().

src/library/sodium_compat/src/Crypto32.php 1 location

@@ 732-746 (lines=15) @@
729
     * @param string $message
730
     * @return string
731
     */
732
    public static function generichash_update($ctx, $message)
733
    {
734
        // This ensures that ParagonIE_Sodium_Core32_BLAKE2b::$iv is initialized
735
        ParagonIE_Sodium_Core32_BLAKE2b::pseudoConstructor();
736
737
        /** @var SplFixedArray $context */
738
        $context = ParagonIE_Sodium_Core32_BLAKE2b::stringToContext($ctx);
739
740
        /** @var SplFixedArray $in */
741
        $in = ParagonIE_Sodium_Core32_BLAKE2b::stringToSplFixedArray($message);
742
743
        ParagonIE_Sodium_Core32_BLAKE2b::update($context, $in, $in->count());
744
745
        return ParagonIE_Sodium_Core32_BLAKE2b::contextToString($context);
746
    }
747
748
    /**
749
     * Libsodium's crypto_kx().