| 7 | import com.lesspass.android.Crypto; |
| 8 | |
| 9 | public class CryptoTest { |
| 10 | @Test |
| 11 | public void testPbkdf2() { |
| 12 | String password = "password"; |
| 13 | String salt = "example.orgcontact@example.org1"; |
| 14 | String result = new Crypto().pbkdf2(password, salt, 100000, 32); |
| 15 | assertEquals("dc33d431bce2b01182c613382483ccdb0e2f66482cbba5e9d07dab34acc7eb1e", result); |
| 16 | } |
| 17 | |
| 18 | @Test |
| 19 | public void testPbkdf2WithUnicodeChar() { |
| 20 | String password = "I ❤ LessPass"; |
| 21 | String salt = "example.org❤1"; |
| 22 | String result = new Crypto().pbkdf2(password, salt, 100000, 32); |
| 23 | assertEquals("4e66cab40690c01af55efd595f5963cc953d7e10273c01827881ebf8990c627f", result); |
| 24 | } |
| 25 | |
| 26 | @Test |
| 27 | public void testHMAC() { |
| 28 | String result = new Crypto().hmac("password"); |
| 29 | assertEquals("e56a207acd1e6714735487c199c6f095844b7cc8e5971d86c003a7b6f36ef51e", result); |
| 30 | } |
| 31 | } |
nothing calls this directly
no outgoing calls
no test coverage detected