@@ -160,6 +160,36 @@ public void setUser(AESKey key, Cipher wrapper, byte[] userIdBuffer, short userI
160160 this .userIdLength = userIdLength ;
161161 }
162162
163+ public void unpackUserID (AESKey key , Cipher unwrapper , byte [] targetBuffer , short targetOffset ) {
164+ unwrapper .init (key , Cipher .MODE_DECRYPT , userIV , (short ) 0 , (short ) userIV .length );
165+ unwrapper .doFinal (userId , (short ) 0 , (short ) userId .length ,
166+ targetBuffer , targetOffset );
167+ }
168+
169+ public void unpackPublicKey (AESKey key , Cipher unwrapper , byte [] targetBuffer , short targetOffset ) {
170+ unwrapper .init (key , Cipher .MODE_DECRYPT , pubKeyIV , (short ) 0 , (short ) pubKeyIV .length );
171+ unwrapper .doFinal (publicKey , (short ) 0 , (short ) publicKey .length ,
172+ targetBuffer , targetOffset );
173+ }
174+
175+ public void unpackRpId (AESKey key , Cipher unwrapper , byte [] targetBuffer , short targetOffset ) {
176+ unwrapper .init (key , Cipher .MODE_DECRYPT , RPIV , (short ) 0 , (short ) RPIV .length );
177+ unwrapper .doFinal (rpId , (short ) 0 , (short ) rpId .length ,
178+ targetBuffer , targetOffset );
179+ }
180+
181+ public void unpackCredBlob (AESKey key , Cipher unwrapper , byte [] targetBuffer , short targetOffset ) {
182+ unwrapper .init (key , Cipher .MODE_DECRYPT , credBlobIV , (short ) 0 , (short ) credBlobIV .length );
183+ unwrapper .doFinal (credBlob , (short ) 0 , (short ) credBlob .length ,
184+ targetBuffer , targetOffset );
185+ }
186+
187+ public void emitLargeBlobKey (AESKey key , Cipher wrapper , byte [] targetBuffer , short targetOffset ) {
188+ wrapper .init (key , Cipher .MODE_ENCRYPT , largeBlobIV , (short ) 0 , (short ) largeBlobIV .length );
189+ wrapper .doFinal (publicKey , (short ) 0 , (short ) 32 ,
190+ targetBuffer , targetOffset );
191+ }
192+
163193 public byte [] getCounter () {
164194 return counter ;
165195 }
@@ -196,36 +226,6 @@ public byte getRpIdLength() {
196226 return rpIdLength ;
197227 }
198228
199- public void unpackUserID (AESKey key , Cipher unwrapper , byte [] targetBuffer , short targetOffset ) {
200- unwrapper .init (key , Cipher .MODE_DECRYPT , userIV , (short ) 0 , (short ) userIV .length );
201- unwrapper .doFinal (userId , (short ) 0 , (short ) userId .length ,
202- targetBuffer , targetOffset );
203- }
204-
205- public void unpackPublicKey (AESKey key , Cipher unwrapper , byte [] targetBuffer , short targetOffset ) {
206- unwrapper .init (key , Cipher .MODE_DECRYPT , pubKeyIV , (short ) 0 , (short ) pubKeyIV .length );
207- unwrapper .doFinal (publicKey , (short ) 0 , (short ) publicKey .length ,
208- targetBuffer , targetOffset );
209- }
210-
211- public void unpackRpId (AESKey key , Cipher unwrapper , byte [] targetBuffer , short targetOffset ) {
212- unwrapper .init (key , Cipher .MODE_DECRYPT , RPIV , (short ) 0 , (short ) RPIV .length );
213- unwrapper .doFinal (rpId , (short ) 0 , (short ) rpId .length ,
214- targetBuffer , targetOffset );
215- }
216-
217- public void unpackCredBlob (AESKey key , Cipher unwrapper , byte [] targetBuffer , short targetOffset ) {
218- unwrapper .init (key , Cipher .MODE_DECRYPT , credBlobIV , (short ) 0 , (short ) credBlobIV .length );
219- unwrapper .doFinal (credBlob , (short ) 0 , (short ) credBlob .length ,
220- targetBuffer , targetOffset );
221- }
222-
223- public void emitLargeBlobKey (AESKey key , Cipher wrapper , byte [] targetBuffer , short targetOffset ) {
224- wrapper .init (key , Cipher .MODE_ENCRYPT , largeBlobIV , (short ) 0 , (short ) largeBlobIV .length );
225- wrapper .doFinal (publicKey , (short ) 0 , (short ) 32 ,
226- targetBuffer , targetOffset );
227- }
228-
229229 public byte getCredBlobLen () {
230230 return this .credBlobLen ;
231231 }
0 commit comments