title: How to calculate a 256-bit HMAC_SHA3 hash with CryptoJS?
body: <p>Recent CryptoJS versions support SHA3 hashing. </p>
  
  <p>SHA3 can output different hash sizes, including 512-bit (default) and 256-bit. These two work fine:</p>
  
  <pre><code>var sha3_512_hash = CryptoJS.SHA3( 'test' );
  var sha3_256_hash = CryptoJS.SHA3( 'test' , { outputLength:256 } );
  </code></pre>
  
  <p>Similarly, CryptoJS can also calculate HMAC values. However, I can't figure out how to change the default output size there:</p>
  
  <pre><code>var sha3_512_hmac = CryptoJS.HmacSHA3( 'test' , 'key' );
  var sha3_256_hmac = CryptoJS.HmacSHA3( 'test' , 'key' , { outputLength:256 } );
  </code></pre>
  
  <p>The first works OK (the result is a 512-bit hmac value) but the second is the <em>same</em> (i.e. also 512-bit), as if it ignores the {outputLength:256} parameter!</p>
  
  <p>Here's a live example: <a href="http://jsfiddle.net/M8xf3/" rel="nofollow">http://jsfiddle.net/M8xf3/</a> (using hmac-sha3.js from CryptoJS 3.1.2)</p>
  
  <p>Does anyone know how to create 256-bit SHA3-based HMAC hashes?</p>
  
  <p>P.S. For the SHA2 family of functions, CryptoJS has separate Hmac functions for each output size (that's HmacSHA256 and HmacSHA512). But this doesn't seem to be the case for SHA3?</p>