sha2_64bit_test.js
No description.

File Location

/goog/crypt/sha2_64bit_test.js


Public Protected Private

Global Functions

hashGoldenTester(hasherlength)
Function called by the actual testers to ensure that specific strings hash to specific published values. Each item in the vector has a "source" and one or more additional keys. If the item has a key matching the key argument passed to this function, it is the expected value of the hash function.
Arguments:
hasher : !goog.crypt.Sha2_64bit
The hasher to test
length : number
The length of the resulting hash, in bits. Also the key to use in TEST_VECTOR for the expected hash value
code »
testBadInput_byteTooLarge()
No description.
code »
testBadInput_characterTooLarge()
No description.
code »
testBadInput_mustBeByteArray()
No description.
code »
testBadInput_negativeNotAllowed()
No description.
code »
testBadInput_noFloatingPoint()
No description.
code »
testBadInput_nullNotAllowed()
Check that the code throws an error for bad input
code »
testBasicOperations()
Simple sanity tests for hash functions.
code »
testFencepostErrors()
Make sure that we correctly handle strings whose length is 110-113. This is the area where we are likely to hit fencepost errors in the padding code.
code »
testHasherNeedsReset_beforeDigest()
No description.
code »
testHasherNeedsReset_beforeUpdate()
No description.
code »
testHashing256()
Test that Sha512_256 returns the published values
code »
testHashing384()
Test that Sha384 returns the published values
code »
testHashing512()
Test that Sha512() returns the published values
code »
testHashing512Large()
Test one really large string using SHA512
code »
testHashing_optLength()
Test that the opt_length works
code »

Global Variables

A128 :
No description.
Code »
A64 :
No description.
Code »
TEST_FENCEPOST_VECTOR :
For each integer key N, the value is the SHA-512 value of a string consisting of N repetitions of the character 'a'.
Code »
TEST_VECTOR :
Each object in the test vector array is a source text and one or more hashes of that source text. The source text is either a string or a byte array.

All hash values, except for the empty string, are from public sources: csrc.nist.gov/publications/fips/fips180-2/fips180-2withchangenotice.pdf csrc.nist.gov/groups/ST/toolkit/documents/Examples/SHA384.pdf csrc.nist.gov/groups/ST/toolkit/documents/Examples/SHA512_256.pdf csrc.nist.gov/groups/ST/toolkit/documents/Examples/SHA2_Additional.pdf en.wikipedia.org/wiki/SHA-2#Examples_of_SHA-2_variants

Code »

Directory crypt

File Reference