nl_tokens: / * Copyright 2013 Research In Motion Limited .
pl_tokens: function katSHA ( ) { var which = Array ( "raw" , "hex" , "b64" ) ; var testVectors = katSHAvector ; var message = "" ; message += "<h2>SHA KAT</h2>" ; message += "<table>" ; for ( var i = 0 ; i < testVectors . length ; ++ i ) { var suite = testVectors [ i ] ; for ( var j = 0 ; j < which . length ; ++ j ) { var encoding = which [ j ] ; var toHash = suite [ encoding ] ; var params = { <mask> : { } } ; params . input [ encoding ] = toHash ; var results = suite . results ; for ( var k = 0 ; k < results . length ; ++ k ) { var kat = results [ k ] ; var alg = kat . alg ; params . alg = alg ; var live = community . gseCrypto . hash ( params ) . output ; var match = kat . hex == live . hex ; message += ( "<tr>" ) ; message += ( "<td class='" + ( match ? "pass" : "fail" ) + "'>" + match + "</td>" ) ; match = kat . b64 == live . b64 ; message += ( "<td class='" + ( match ? "pass" : "fail" ) + "'>" + match + "</td>" ) ; message += ( "<td>" + JSON . stringify ( params ) + "</td>" ) ; message += ( "<td>" + kat . hex + "<br />" + live . hex + "</td>" ) ; message += ( "<td>" + kat . b64 + "<br />" + live . b64 + "</td>" ) ; message += ( "</tr>" ) ; } } } message += ( "</table>" ) ; log ( message ) ; }