Interface GenericHash.Native

    • Method Detail

      • cryptoGenericHash

        boolean cryptoGenericHash​(byte[] out,
                                  int outLen,
                                  byte[] in,
                                  long inLen,
                                  byte[] key,
                                  int keyLen)
        Hash a byte array.
        Parameters:
        out - A place to store the resulting byte array. You may choose the output size, however the minimum recommended output size is GenericHash.BYTES. You may also specify a value between GenericHash.BYTES_MIN and GenericHash.BYTES_MAX.
        outLen - Size of out.
        in - The text to hash.
        inLen - The size of in.
        key - The key generated by cryptoGenericHashKeygen(byte[]).
        keyLen - The length of the key.
        Returns:
        True if successfully hashed.
      • cryptoGenericHashInit

        boolean cryptoGenericHashInit​(byte[] state,
                                      byte[] key,
                                      int keyLength,
                                      int outLen)
        Hash multiple parts of a message.
        Parameters:
        state - The state which holds the key in memory for further hashing.
        key - The key generated by cryptoGenericHashKeygen(byte[]).
        keyLength - Length of the key.
        outLen - The size of the hash array. Please see the param out in cryptoGenericHash(byte[], int, byte[], long, byte[], int) for more information.
        Returns:
        True if initialised.
      • cryptoGenericHashInit

        boolean cryptoGenericHashInit​(byte[] state,
                                      int outLen)
        Hash multiple parts of a message without a key
        Parameters:
        state - The state which holds the current state in memory for further hashing.
        outLen - The size of the hash array. Please see the param out in cryptoGenericHash(byte[], int, byte[], long, byte[], int) for more information.
        Returns:
        True if initialised.
      • cryptoGenericHashUpdate

        boolean cryptoGenericHashUpdate​(byte[] state,
                                        byte[] in,
                                        long inLen)
        Update a multi-part hashing with another part.
        Parameters:
        state - The state.
        in - Another hash part.
        inLen - The length if the hash part.
        Returns:
        True if this part of the message was hashed.
      • cryptoGenericHashFinal

        boolean cryptoGenericHashFinal​(byte[] state,
                                       byte[] out,
                                       int outLen)
        Now that the hash has finalised, the hash can be put into out.
        Parameters:
        state - The state.
        out - The final hash.
        outLen - The length of the hash.
        Returns:
        True if hashed.
      • cryptoGenericHashStateBytes

        int cryptoGenericHashStateBytes()