make all T params final in User in java
This commit is contained in:
parent
3efd0be63f
commit
b73102513e
1 changed files with 3 additions and 3 deletions
|
@ -19,18 +19,18 @@ public class User<T extends IGF, D extends IDHSetup<T>> {
|
|||
return this.dh.power(dh.getGenerator(), this.secret);
|
||||
}
|
||||
|
||||
public void setKey(T a) {
|
||||
public void setKey(final T a) {
|
||||
this.key = this.dh.power(a, this.secret);
|
||||
}
|
||||
|
||||
public T encrypt(T m) throws IllegalArgumentException {
|
||||
public T encrypt(final T m) throws IllegalArgumentException {
|
||||
if (this.key.isZero()) {
|
||||
throw new IllegalArgumentException("key must be set before encrypting");
|
||||
}
|
||||
return (T) m.multiply(this.key);
|
||||
}
|
||||
|
||||
public T decrypt(T c) throws IllegalArgumentException {
|
||||
public T decrypt(final T c) throws IllegalArgumentException {
|
||||
if (this.key.isZero()) {
|
||||
throw new IllegalArgumentException("key must be set before decrypting");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue