Skip to content

Commit 24a9320

Browse files
committed
Fix JavaDoc warnings
1 parent af08bc0 commit 24a9320

File tree

10 files changed

+57
-12
lines changed

10 files changed

+57
-12
lines changed

src/net/i2p/crypto/eddsa/EdDSAEngine.java

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,8 @@ private boolean x_engineVerify(byte[] sigBytes) throws SignatureException {
318318
* sig = sign()
319319
*</pre>
320320
*
321+
* @param data the message to be signed
322+
* @return the signature
321323
* @throws SignatureException if update() already called
322324
* @see #ONE_SHOT_MODE
323325
*/
@@ -336,6 +338,10 @@ public byte[] signOneShot(byte[] data) throws SignatureException {
336338
* sig = sign()
337339
*</pre>
338340
*
341+
* @param data byte array containing the message to be signed
342+
* @param off the start of the message inside data
343+
* @param len the length of the message
344+
* @return the signature
339345
* @throws SignatureException if update() already called
340346
* @see #ONE_SHOT_MODE
341347
*/
@@ -356,6 +362,9 @@ public byte[] signOneShot(byte[] data, int off, int len) throws SignatureExcepti
356362
* ok = verify(signature)
357363
*</pre>
358364
*
365+
* @param data the message that was signed
366+
* @param signature of the message
367+
* @return true if the signature is valid, false otherwise
359368
* @throws SignatureException if update() already called
360369
* @see #ONE_SHOT_MODE
361370
*/
@@ -374,6 +383,11 @@ public boolean verifyOneShot(byte[] data, byte[] signature) throws SignatureExce
374383
* ok = verify(signature)
375384
*</pre>
376385
*
386+
* @param data byte array containing the message that was signed
387+
* @param off the start of the message inside data
388+
* @param len the length of the message
389+
* @param signature of the message
390+
* @return true if the signature is valid, false otherwise
377391
* @throws SignatureException if update() already called
378392
* @see #ONE_SHOT_MODE
379393
*/
@@ -392,6 +406,11 @@ public boolean verifyOneShot(byte[] data, int off, int len, byte[] signature) th
392406
* ok = verify(signature, sigoff, siglen)
393407
*</pre>
394408
*
409+
* @param data the message that was signed
410+
* @param signature byte array containing the signature
411+
* @param sigoff the start of the signature
412+
* @param siglen the length of the signature
413+
* @return true if the signature is valid, false otherwise
395414
* @throws SignatureException if update() already called
396415
* @see #ONE_SHOT_MODE
397416
*/
@@ -410,6 +429,13 @@ public boolean verifyOneShot(byte[] data, byte[] signature, int sigoff, int sigl
410429
* ok = verify(signature, sigoff, siglen)
411430
*</pre>
412431
*
432+
* @param data byte array containing the message that was signed
433+
* @param off the start of the message inside data
434+
* @param len the length of the message
435+
* @param signature byte array containing the signature
436+
* @param sigoff the start of the signature
437+
* @param siglen the length of the signature
438+
* @return true if the signature is valid, false otherwise
413439
* @throws SignatureException if update() already called
414440
* @see #ONE_SHOT_MODE
415441
*/

src/net/i2p/crypto/eddsa/EdDSAKey.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ public interface EdDSAKey {
2424
String KEY_ALGORITHM = "EdDSA";
2525

2626
/**
27-
* return a parameter specification representing the EdDSA domain
28-
* parameters for the key.
27+
* @return a parameter specification representing the EdDSA domain
28+
* parameters for the key.
2929
*/
3030
EdDSAParameterSpec getParams();
3131
}

src/net/i2p/crypto/eddsa/Utils.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
public class Utils {
2222
/**
2323
* Constant-time byte comparison.
24+
* @param b a byte
25+
* @param c a byte
2426
* @return 1 if b and c are equal, 0 otherwise.
2527
*/
2628
public static int equal(int b, int c) {
@@ -34,6 +36,8 @@ public static int equal(int b, int c) {
3436

3537
/**
3638
* Constant-time byte[] comparison.
39+
* @param b a byte[]
40+
* @param c a byte[]
3741
* @return 1 if b and c are equal, 0 otherwise.
3842
*/
3943
public static int equal(byte[] b, byte[] c) {

src/net/i2p/crypto/eddsa/math/Encoding.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ public synchronized void setField(Field f) {
2828

2929
/**
3030
* Encode a FieldElement in its $(b-1)$-bit encoding.
31+
* @param x the FieldElement to encode
3132
* @return the $(b-1)$-bit encoding of this FieldElement.
3233
*/
3334
public abstract byte[] encode(FieldElement x);
@@ -46,6 +47,7 @@ public synchronized void setField(Field f) {
4647
* than the $(b-1)$-bit encoding of -x. If $q$ is an odd prime and the encoding
4748
* is the little-endian representation of $\{0, 1,\dots, q-1\}$ then the negative
4849
* elements of $F_q$ are $\{1, 3, 5,\dots, q-2\}$.
50+
* @param x the FieldElement to check
4951
* @return true if negative
5052
*/
5153
public abstract boolean isNegative(FieldElement x);

src/net/i2p/crypto/eddsa/math/GroupElement.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ public synchronized void precompute(final boolean precomputeSingle) {
505505
* $r$ in $P \times P$ representation:
506506
* <p>
507507
* $r = ((X' : Z'), (Y' : T'))$ where
508-
* <p><ul>
508+
* </p><ul>
509509
* <li>$X' = (X + Y)^2 - (Y^2 + X^2)$
510510
* <li>$Y' = Y^2 + X^2$
511511
* <li>$Z' = y^2 - X^2$
@@ -514,7 +514,7 @@ public synchronized void precompute(final boolean precomputeSingle) {
514514
* $r$ converted from $P \times P$ to $P^2$ representation:
515515
* <p>
516516
* $r = (X'' : Y'' : Z'')$ where
517-
* <p><ul>
517+
* </p><ul>
518518
* <li>$X'' = X' * Z' = ((X + Y)^2 - Y^2 - X^2) * (2 * Z^2 - (y^2 - X^2))$
519519
* <li>$Y'' = Y' * T' = (Y^2 + X^2) * (2 * Z^2 - (y^2 - X^2))$
520520
* <li>$Z'' = Z' * T' = (y^2 - X^2) * (2 * Z^2 - (y^2 - X^2))$
@@ -647,14 +647,14 @@ private GroupElement msub(GroupElement q) {
647647
* $r = p + q$ where $p = this = (X1 : Y1 : Z1 : T1), q = (q.X, q.Y, q.Z, q.T) = (Y2 + X2, Y2 - X2, Z2, 2 * d * T2)$
648648
* <p>
649649
* $r$ in $P \times P$ representation:
650-
* <p><ul>
650+
* </p><ul>
651651
* <li>$X' = (Y1 + X1) * (Y2 + X2) - (Y1 - X1) * (Y2 - X2)$
652652
* <li>$Y' = (Y1 + X1) * (Y2 + X2) + (Y1 - X1) * (Y2 - X2)$
653653
* <li>$Z' = 2 * Z1 * Z2 + 2 * d * T1 * T2$
654654
* <li>$T' = 2 * Z1 * T2 - 2 * d * T1 * T2$
655655
* </ul><p>
656656
* Setting $A = (Y1 - X1) * (Y2 - X2), B = (Y1 + X1) * (Y2 + X2), C = 2 * d * T1 * T2, D = 2 * Z1 * Z2$ we get
657-
* <p><ul>
657+
* </p><ul>
658658
* <li>$X' = (B - A)$
659659
* <li>$Y' = (B + A)$
660660
* <li>$Z' = (D + C)$

src/net/i2p/crypto/eddsa/math/ScalarOps.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@ public interface ScalarOps {
1818
* From the Ed25519 paper:<br>
1919
* Here we interpret $2b$-bit strings in little-endian form as integers in
2020
* $\{0, 1,..., 2^{(2b)}-1\}$.
21-
* @param s
21+
* @param s the scalar to reduce
2222
* @return $s \bmod l$
2323
*/
2424
public byte[] reduce(byte[] s);
2525

2626
/**
2727
* $r = (a * b + c) \bmod l$
28-
* @param a
29-
* @param b
30-
* @param c
28+
* @param a a scalar
29+
* @param b a scalar
30+
* @param c a scalar
3131
* @return $(a*b + c) \bmod l$
3232
*/
3333
public byte[] multiplyAndAdd(byte[] a, byte[] b, byte[] c);

src/net/i2p/crypto/eddsa/math/bigint/BigIntegerLittleEndianEncoding.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public byte[] encode(FieldElement x) {
3939
* Convert $x$ to little endian.
4040
* Constant time.
4141
*
42+
* @param x the BigInteger value to encode
4243
* @return array of length $b/8$
4344
* @throws IllegalStateException if field not set
4445
*/
@@ -75,6 +76,9 @@ public FieldElement decode(byte[] in) {
7576

7677
/**
7778
* Convert in to big endian
79+
*
80+
* @param in the $(b-1)$-bit encoding of a FieldElement.
81+
* @return the decoded value as a BigInteger
7882
*/
7983
public BigInteger toBigInteger(byte[] in) {
8084
byte[] out = new byte[in.length];

src/net/i2p/crypto/eddsa/spec/EdDSAParameterSpec.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ public class EdDSAParameterSpec implements AlgorithmParameterSpec, Serializable
3434
private final GroupElement B;
3535

3636
/**
37-
* @throws IllegalArgumentException if hash algorithm is unsupported or length is wrong
37+
* @param curve the curve
38+
* @param hashAlgo the JCA string for the hash algorithm
39+
* @param sc the parameter L represented as ScalarOps
40+
* @param B the parameter B
41+
* @throws IllegalArgumentException if hash algorithm is unsupported or length is wrong
3842
*/
3943
public EdDSAParameterSpec(Curve curve, String hashAlgo,
4044
ScalarOps sc, GroupElement B) {

src/net/i2p/crypto/eddsa/spec/EdDSAPrivateKeySpec.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ public class EdDSAPrivateKeySpec implements KeySpec {
3030
private final EdDSAParameterSpec spec;
3131

3232
/**
33+
* @param seed the private key
34+
* @param spec the parameter specification for this key
3335
* @throws IllegalArgumentException if seed length is wrong or hash algorithm is unsupported
3436
*/
3537
public EdDSAPrivateKeySpec(byte[] seed, EdDSAParameterSpec spec) {
@@ -67,6 +69,7 @@ public EdDSAPrivateKeySpec(byte[] seed, EdDSAParameterSpec spec) {
6769
* Initialize directly from the hash.
6870
* getSeed() will return null if this constructor is used.
6971
*
72+
* @param spec the parameter specification for this key
7073
* @param h the private key
7174
* @throws IllegalArgumentException if hash length is wrong
7275
* @since 0.1.1

src/net/i2p/crypto/eddsa/spec/EdDSAPublicKeySpec.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ public class EdDSAPublicKeySpec implements KeySpec {
2525
private final EdDSAParameterSpec spec;
2626

2727
/**
28-
* @throws IllegalArgumentException if key length is wrong
28+
* @param pk the public key
29+
* @param spec the parameter specification for this key
30+
* @throws IllegalArgumentException if key length is wrong
2931
*/
3032
public EdDSAPublicKeySpec(byte[] pk, EdDSAParameterSpec spec) {
3133
if (pk.length != spec.getCurve().getField().getb()/8)

0 commit comments

Comments
 (0)