239240241242243244245246247248249
for (int i=0;i<secrets.length;i++){ SHA1Hasher hasher = new SHA1Hasher(); hasher.update( REQ2_IV ); hasher.update( secrets[i] ); byte[] encoded = hasher.getDigest(); synchronized( global_shared_secrets ){
559560561562563564565566567568569
//"HASH('keyA', S, SKEY)" if you're A //"HASH('keyB', S, SKEY)" if you're B SHA1Hasher hasher = new SHA1Hasher(); hasher.update( KEYA_IV ); hasher.update( secret_bytes ); hasher.update( shared_secret ); byte[] a_key = hasher.getDigest();
560561562563564565566567568569570
//"HASH('keyB', S, SKEY)" if you're B SHA1Hasher hasher = new SHA1Hasher(); hasher.update( KEYA_IV ); hasher.update( secret_bytes ); hasher.update( shared_secret ); byte[] a_key = hasher.getDigest(); hasher = new SHA1Hasher();
561562563564565566567568569570571
SHA1Hasher hasher = new SHA1Hasher(); hasher.update( KEYA_IV ); hasher.update( secret_bytes ); hasher.update( shared_secret ); byte[] a_key = hasher.getDigest(); hasher = new SHA1Hasher();
567568569570571572573574575576577
byte[] a_key = hasher.getDigest(); hasher = new SHA1Hasher(); hasher.update( KEYB_IV ); hasher.update( secret_bytes ); hasher.update( shared_secret ); byte[] b_key = hasher.getDigest();
568569570571572573574575576577578
byte[] a_key = hasher.getDigest(); hasher = new SHA1Hasher(); hasher.update( KEYB_IV ); hasher.update( secret_bytes ); hasher.update( shared_secret ); byte[] b_key = hasher.getDigest(); SecretKeySpec secret_key_spec_a = new SecretKeySpec( a_key, RC4_STREAM_ALG );
569570571572573574575576577578579
hasher = new SHA1Hasher(); hasher.update( KEYB_IV ); hasher.update( secret_bytes ); hasher.update( shared_secret ); byte[] b_key = hasher.getDigest(); SecretKeySpec secret_key_spec_a = new SecretKeySpec( a_key, RC4_STREAM_ALG );
855856857858859860861862863864865
// HASH('req1', S) SHA1Hasher hasher = new SHA1Hasher(); hasher.update( REQ1_IV ); hasher.update( secret_bytes ); byte[] sha1 = hasher.getDigest(); write_buffer.put( sha1 );
856857858859860861862863864865866
866867868869870871872873874875876
// HASH('req2', SKEY)^HASH('req3', S) hasher = new SHA1Hasher(); hasher.update( REQ2_IV ); hasher.update( shared_secret ); byte[] sha1_1 = hasher.getDigest(); hasher = new SHA1Hasher();