File tree Expand file tree Collapse file tree 2 files changed +0
-15
lines changed
Expand file tree Collapse file tree 2 files changed +0
-15
lines changed Original file line number Diff line number Diff line change 55
66import java .io .UnsupportedEncodingException ;
77import java .security .SecureRandom ;
8- import java .util .Base64 ;
98import java .lang .System ;
109import java .util .concurrent .atomic .AtomicLong ;
1110
@@ -3390,16 +3389,6 @@ public static byte[] makeSecretBoxNonce() {
33903389 return randombytes (SecretBox .nonceLength );
33913390 }
33923391
3393- public static String base64EncodeToString (byte [] b ) {
3394- return Base64 .getUrlEncoder ().withoutPadding ().encodeToString (b );
3395- }
3396- // byte[] Base64.getUrlEncoder().withoutPadding().encode(b);
3397-
3398- public static byte [] base64Decode (String s ) {
3399- return Base64 .getUrlDecoder ().decode (s );
3400- }
3401- // byte[] Base64.getUrlDecoder().decode(byte[] b)
3402-
34033392 public static String hexEncodeToString ( byte [] raw ) {
34043393 String HEXES = "0123456789ABCDEF" ;
34053394 final StringBuilder hex = new StringBuilder ( 2 * raw .length );
Original file line number Diff line number Diff line change @@ -194,17 +194,13 @@ private boolean testBoxNonce() throws UnsupportedEncodingException {
194194
195195 // explicit nonce
196196 byte [] theNonce = TweetNaclFast .makeBoxNonce ();
197- byte [] theNonce2 = TweetNaclFast .base64Decode (
198- TweetNaclFast .base64EncodeToString (theNonce ));
199- Log .d (TAG , "BoxNonce Base64 test Equal: " + "\" " + java .util .Arrays .equals (theNonce , theNonce2 ) + "\" " );
200197 byte [] theNonce3 = TweetNaclFast .hexDecode (
201198 TweetNaclFast .hexEncodeToString (theNonce ));
202199 Log .d (TAG , "BoxNonce Hex test Equal: " + "\" " + java .util .Arrays .equals (theNonce , theNonce3 ) + "\" " );
203200 String theNoncet = "" ;
204201 for (int i = 0 ; i < theNonce .length ; i ++)
205202 theNoncet += " " +theNonce [i ];
206203 Log .d (TAG , "BoxNonce: " +theNoncet );
207- Log .d (TAG , "BoxNonce: " + "\" " + TweetNaclFast .base64EncodeToString (theNonce ) + "\" " );
208204 Log .d (TAG , "BoxNonce: " + "\" " + TweetNaclFast .hexEncodeToString (theNonce ) + "\" " );
209205
210206
You can’t perform that action at this time.
0 commit comments