Skip to content

Commit 651a3dc

Browse files
committed
v2.4
Code cleanup removed unused dependencies and improved an exception so that it's understandable
1 parent 70e2bde commit 651a3dc

9 files changed

Lines changed: 41 additions & 13 deletions

File tree

app/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ android {
1313
applicationId = "uk.arias.app_psi"
1414
minSdk = 26
1515
targetSdk = 34
16-
versionCode = 4
17-
versionName = "2.3"
16+
versionCode = 5
17+
versionName = "2.4"
1818

1919
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
2020
}
3.88 KB
Binary file not shown.
3.79 KB
Binary file not shown.

app/release/output-metadata 2.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"version": 3,
3+
"artifactType": {
4+
"type": "APK",
5+
"kind": "Directory"
6+
},
7+
"applicationId": "uk.arias.app_psi",
8+
"variantName": "release",
9+
"elements": [
10+
{
11+
"type": "SINGLE",
12+
"filters": [],
13+
"attributes": [],
14+
"versionCode": 5,
15+
"versionName": "2.4",
16+
"outputFile": "app-release.apk"
17+
}
18+
],
19+
"elementType": "File",
20+
"baselineProfiles": [
21+
{
22+
"minApi": 28,
23+
"maxApi": 30,
24+
"baselineProfiles": [
25+
"baselineProfiles/1/app-release.dm"
26+
]
27+
},
28+
{
29+
"minApi": 31,
30+
"maxApi": 2147483647,
31+
"baselineProfiles": [
32+
"baselineProfiles/0/app-release.dm"
33+
]
34+
}
35+
],
36+
"minSdkVersionForDexing": 26
37+
}

app/src/main/java/uk/arias/app_psi/handlers/IntersectionHandler.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,9 @@
1414
import com.google.gson.internal.LinkedTreeMap;
1515

1616
import org.jetbrains.annotations.Nullable;
17-
import org.zeromq.ZMQ;
1817

1918
import java.util.ArrayList;
2019
import java.util.HashMap;
21-
import java.util.logging.Level;
2220

2321
public abstract class IntersectionHandler {
2422

app/src/main/java/uk/arias/app_psi/handlers/OPECAHandler.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import java.util.ArrayList;
1616
import java.util.Collections;
1717
import java.util.List;
18-
import java.util.logging.Level;
1918

2019
public class OPECAHandler extends IntersectionHandler {
2120

app/src/main/java/uk/arias/app_psi/handlers/OPEHandler.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package uk.arias.app_psi.handlers;
22

33
import android.os.Debug;
4-
import android.os.Parcel;
54
import android.util.Log;
65

76
import androidx.annotation.NonNull;
@@ -17,7 +16,6 @@
1716
import java.util.ArrayList;
1817
import java.util.List;
1918
import java.util.Objects;
20-
import java.util.logging.Level;
2119

2220
public class OPEHandler extends IntersectionHandler {
2321

app/src/main/java/uk/arias/app_psi/implementations/DamgardJurik.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package uk.arias.app_psi.implementations;
22

3-
import android.util.Log;
4-
53
import androidx.annotation.NonNull;
64

75
import java.math.BigInteger;
@@ -51,7 +49,7 @@ public void keyGeneration(int bitLength) {
5149

5250
BigInteger a = g.modPow(lambda, nPowSPlusOne).subtract(BigInteger.ONE).divide(n);
5351
if (!a.gcd(n).equals(BigInteger.ONE)) {
54-
throw new ArithmeticException("BigInteger not invertible. COMPROBAR n y lambda!!");
52+
throw new ArithmeticException("No se ha podido calcular mu, comprobar n y lambda.");
5553
} else {
5654
mu = a.modInverse(n);
5755
}

app/src/main/java/uk/arias/app_psi/implementations/Paillier.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package uk.arias.app_psi.implementations;
22

3-
import android.util.Log;
4-
53
import androidx.annotation.NonNull;
64

75
import java.math.BigInteger;
@@ -47,7 +45,7 @@ public void keyGeneration(int bitLengthVal) {
4745
p.subtract(BigInteger.ONE).gcd(q.subtract(BigInteger.ONE))); // Calcula lambda
4846
BigInteger a = g.modPow(lambda, nsquare).subtract(BigInteger.ONE).divide(n); // Se calcula mu como L(g^lambda mod n^2)^-1 mod n
4947
if (!a.gcd(n).equals(BigInteger.ONE)) {
50-
throw new ArithmeticException("BigInteger not invertible. COMPROBAR n y lambda!!");
48+
throw new ArithmeticException("No se ha podido calcular mu, comprobar n y lambda.");
5149
} else {
5250
mu = a.modInverse(n);
5351
}

0 commit comments

Comments
 (0)