2015-10-01 19:28:29 +00:00
|
|
|
package org.thoughtcrime.securesms.crypto;
|
|
|
|
|
|
|
|
import org.junit.Before;
|
|
|
|
import org.junit.Test;
|
|
|
|
import org.powermock.core.classloader.annotations.PowerMockIgnore;
|
|
|
|
import org.thoughtcrime.securesms.BaseUnitTest;
|
2016-03-23 17:34:41 +00:00
|
|
|
import org.whispersystems.libsignal.InvalidMessageException;
|
2015-10-01 19:28:29 +00:00
|
|
|
|
|
|
|
@PowerMockIgnore("javax.crypto.*")
|
|
|
|
public class MasterCipherTest extends BaseUnitTest {
|
|
|
|
private MasterCipher masterCipher;
|
|
|
|
|
|
|
|
@Before
|
|
|
|
@Override
|
|
|
|
public void setUp() throws Exception {
|
|
|
|
super.setUp();
|
|
|
|
masterCipher = new MasterCipher(masterSecret);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Test(expected = InvalidMessageException.class)
|
|
|
|
public void testEncryptBytesWithZeroBody() throws Exception {
|
|
|
|
masterCipher.decryptBytes(new byte[]{});
|
|
|
|
}
|
|
|
|
}
|