mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-27 12:05:22 +00:00
Make generated PreKeyIds exclude both 0 and Medium.MAX_VALUE.
This commit is contained in:
parent
006c9aae7b
commit
2db44a1578
@ -71,8 +71,10 @@ public class KeyHelper {
|
||||
public static List<PreKeyRecord> generatePreKeys(int start, int count) {
|
||||
List<PreKeyRecord> results = new LinkedList<>();
|
||||
|
||||
start--;
|
||||
|
||||
for (int i=0;i<count;i++) {
|
||||
results.add(new PreKeyRecord((start + i) % Medium.MAX_VALUE, Curve.generateKeyPair()));
|
||||
results.add(new PreKeyRecord(((start + i) % (Medium.MAX_VALUE-1)) + 1, Curve.generateKeyPair()));
|
||||
}
|
||||
|
||||
return results;
|
||||
|
Loading…
Reference in New Issue
Block a user