Simpler key rotation: rotation period R = C + L, retention period = 3R.

This commit is contained in:
akwizgran
2013-04-05 21:15:24 +01:00
parent b109a94155
commit 5b37ff3a0e
8 changed files with 333 additions and 123 deletions

View File

@@ -5,8 +5,8 @@ import net.sf.briar.api.TransportId;
public class Endpoint {
private final ContactId contactId;
private final TransportId transportId;
protected final ContactId contactId;
protected final TransportId transportId;
private final long epoch;
private final boolean alice;

View File

@@ -53,4 +53,20 @@ public class TemporarySecret extends Endpoint {
public byte[] getWindowBitmap() {
return bitmap;
}
@Override
public int hashCode() {
int periodHashCode = (int) (period ^ (period >>> 32));
return contactId.hashCode() ^ transportId.hashCode() ^ periodHashCode;
}
@Override
public boolean equals(Object o) {
if(o instanceof TemporarySecret) {
TemporarySecret s = (TemporarySecret) o;
return contactId.equals(s.contactId) &&
transportId.equals(s.transportId) && period == s.period;
}
return false;
}
}