Reviewed FIXME-comments.
authorNiels Möller <nisse@lysator.liu.se>
Mon, 15 Sep 2008 20:23:24 +0000 (22:23 +0200)
committerNiels Möller <nisse@lysator.liu.se>
Mon, 15 Sep 2008 20:23:24 +0000 (22:23 +0200)
Rev: nettle/aes-decrypt-internal.c:1.2
Rev: nettle/aes-encrypt-internal.c:1.2
Rev: nettle/aes-internal.h:1.2
Rev: nettle/arctwo.h:1.2
Rev: nettle/base16-decode.c:1.2
Rev: nettle/base16-encode.c:1.2
Rev: nettle/base16.h:1.2
Rev: nettle/base64.h:1.2
Rev: nettle/bignum-random.c:1.2
Rev: nettle/bignum.c:1.2
Rev: nettle/bignum.h:1.3
Rev: nettle/rsa-sign.c:1.3
Rev: nettle/rsa-verify.c:1.3
Rev: nettle/rsa.c:1.3
Rev: nettle/rsa.h:1.2
Rev: nettle/sexp-transport-format.c:1.2
Rev: nettle/sexp.c:1.2
Rev: nettle/sexp.h:1.2

18 files changed:
aes-decrypt-internal.c
aes-encrypt-internal.c
aes-internal.h
arctwo.h
base16-decode.c
base16-encode.c
base16.h
base64.h
bignum-random.c
bignum.c
bignum.h
rsa-sign.c
rsa-verify.c
rsa.c
rsa.h
sexp-transport-format.c
sexp.c
sexp.h

index abb78de0f816da75955eeeb471f94ce09df6427b..9dff1660529b1d7359cc37ae947b0c7199bb8791 100644 (file)
@@ -59,9 +59,9 @@ _nettle_aes_decrypt(const struct aes_ctx *ctx,
          t2 = AES_ROUND(T, w2, w1, w0, w3, ctx->keys[4*round + 2]);
          t3 = AES_ROUND(T, w3, w2, w1, w0, ctx->keys[4*round + 3]);
 
-         /* FIXME: We could unrolling the loop twice, to avoid these
-            assignments. If all eight variables fit in registers, that
-            should give a speedup. */
+         /* We could unroll the loop twice, to avoid these
+            assignments. If all eight variables fit in registers,
+            that should give a slight speedup. */
          w0 = t0;
          w1 = t1;
          w2 = t2;
index ca1d803d0bfe0368447ac0df2f507ceba359ec1c..84ed6cff7a1603dd0aa1bb95ee87d28a31b68ad0 100644 (file)
@@ -59,9 +59,9 @@ _nettle_aes_encrypt(const struct aes_ctx *ctx,
          t2 = AES_ROUND(T, w2, w3, w0, w1, ctx->keys[4*round + 2]);
          t3 = AES_ROUND(T, w3, w0, w1, w2, ctx->keys[4*round + 3]);
 
-         /* FIXME: We could unrolling the loop twice, to avoid these
-            assignments. If all eight variables fit in registers, that
-            should give a speedup. */
+         /* We could unroll the loop twice, to avoid these
+            assignments. If all eight variables fit in registers,
+            that should give a slight speedup. */
          w0 = t0;
          w1 = t1;
          w2 = t2;
index dda43d0edb7505011d8c8bf867cfc6a6d9a3890d..a1e8d02219ae1f7c35c297101fa5b200be7d29ed 100644 (file)
@@ -33,7 +33,7 @@
 #define _aes_decrypt _nettle_aes_decrypt
 #define _aes_encrypt_table _nettle_aes_encrypt_table
 
-/* Define to use only small tables. FIXME: Currently not working. */
+/* Define to use only small tables. */
 #ifndef AES_SMALL
 # define AES_SMALL 0
 #endif
index fa1360de52fdbe11b0f72ab63e5be46e289cdbbf..cf3c96d19593b6bb3cbf453277802824ef8f6d2a 100644 (file)
--- a/arctwo.h
+++ b/arctwo.h
@@ -64,8 +64,6 @@ void
 arctwo_set_key (struct arctwo_ctx *ctx, unsigned length, const uint8_t *key);
 
 /* Equvivalent to arctwo_set_key_ekb, with ekb = 1024 */
-/* FIXME: Is this function really needed, and if so, what's the right
-   name for it? */
 void
 arctwo_set_key_gutmann (struct arctwo_ctx *ctx,
                        unsigned length, const uint8_t *key);
index a76d0fe294d6ba4cefcf5ff7a8869a9c93bb5593..2689411a2e6a321f25cbe1a01a4c0625c22bf5e2 100644 (file)
@@ -65,7 +65,6 @@ base16_decode_single(struct base16_decode_ctx *ctx,
   if (src >= 0x80)
     return -1;
 
-  /* FIXME: This code could use more clever choices of constants. */
   digit = hex_decode_table[src];
   switch (digit)
     {
index bc95bc9007c4d5f29b980f872a0167097b1e24a1..b2267ab0d05be5ba380e21c50850e7a8505a57c0 100644 (file)
@@ -35,7 +35,6 @@ hex_digits[16] = "0123456789abcdef";
 
 #define DIGIT(x) (hex_digits[(x) & 0xf])
 
-/* FIXME: Is this really needed? */
 /* Encodes a single byte. Always stores two digits in dst[0] and dst[1]. */
 void
 base16_encode_single(uint8_t *dst,
index 967da4d1ab38dd3aae8cef12c3ac41349e6d9297..960ce775ed65d87cf59347c606e5f3c83ab8f5e3 100644 (file)
--- a/base16.h
+++ b/base16.h
@@ -86,8 +86,8 @@ base16_decode_single(struct base16_decode_ctx *ctx,
  * area before the call. *DST_LENGTH is updated to the amount of
  * decoded output. */
 
-/* FIXME: Currently results in an assertion failure if *DST_LENGTH is
- * too small. Return some error instead? */
+/* Currently results in an assertion failure if *DST_LENGTH is
+ * too small. FIXME: Return some error instead? */
 int
 base16_decode_update(struct base16_decode_ctx *ctx,
                     unsigned *dst_length,
index 279dff992a0221571a1bbab6fae195473d3dadb7..2be186530b0cecb240bc6e814fc4a002a32e8c6d 100644 (file)
--- a/base64.h
+++ b/base64.h
@@ -133,8 +133,8 @@ base64_decode_single(struct base64_decode_ctx *ctx,
  * area before the call. *DST_LENGTH is updated to the amount of
  * decoded output. */
 
-/* FIXME: Currently results in an assertion failure if *DST_LENGTH is
- * too small. Return some error instead? */
+/* Currently results in an assertion failure if *DST_LENGTH is
+ * too small. FIXME: Return some error instead? */
 int
 base64_decode_update(struct base64_decode_ctx *ctx,
                     unsigned *dst_length,
index 16029216b404b704f70f6459f5c272e5d8bb7c0e..6653dea375e321730594c847c1d8a8a94b1b5765 100644 (file)
@@ -57,8 +57,8 @@ nettle_mpz_random(mpz_t x,
                  void *ctx, nettle_random_func random,
                  const mpz_t n)
 {
-  /* FIXME: This leaves some bias, which may be bad for DSA. A better
-   * way might to generate a random number of mpz_sizeinbase(n, 2)
+  /* NOTE: This leaves some bias, which may be bad for DSA. A better
+   * way might be to generate a random number of mpz_sizeinbase(n, 2)
    * bits, and loop until one smaller than n is found. */
 
   /* From Daniel Bleichenbacher (via coderpunks):
index 04a7920dc4febd960aad4596e3470b9530c9aae5..e73f6190bf528b8b29b0fa0696661cf598e8b575 100644 (file)
--- a/bignum.c
+++ b/bignum.c
@@ -120,9 +120,6 @@ nettle_mpz_get_str_256(unsigned length, uint8_t *s, const mpz_t x)
       mpz_init(c);
       mpz_com(c, x);
 
-      /* FIXME: A different trick is to complement all the limbs of c
-       * now. That way, nettle_mpz_to_octets need not complement each
-       * digit. */
       assert(nettle_mpz_sizeinbase_256_u(c) <= length);
       nettle_mpz_to_octets(length, s, c, 0xff);
 
index 97da817185f6687cf317f720de587f25ce27a77c..14d0fc62da56da0e43edd5ade907af9414211a39 100644 (file)
--- a/bignum.h
+++ b/bignum.h
@@ -46,7 +46,6 @@ nettle_mpz_sizeinbase_256_u(const mpz_t x);
 
 /* Writes an integer as length octets, using big endian byte order,
  * and two's complement for negative numbers. */
-/* FIXME: Change order of arguments, putting the mpz_t first? */
 void
 nettle_mpz_get_str_256(unsigned length, uint8_t *s, const mpz_t x);
 
index 4be75cdabefd291479b629d1396bfce8158d1acf..aa407caa104dab2fbf63488a23c8f19a953251b5 100644 (file)
@@ -60,8 +60,6 @@ rsa_private_key_clear(struct rsa_private_key *key)
 int
 rsa_private_key_prepare(struct rsa_private_key *key)
 {
-  /* FIXME: Add further sanity checks. */
-
   mpz_t n;
   
   /* The size of the product is the sum of the sizes of the factors,
index 734eb80d05935bc81a3210f13d7240da7f35efff..2e3b52f5d1baafc0535aba0d36da470c67e4f994 100644 (file)
@@ -48,7 +48,6 @@ _rsa_verify(const struct rsa_public_key *key,
   
   mpz_powm(m1, s, key->e, key->n);
 
-  /* FIXME: Is it cheaper to convert m1 to a string and check that? */
   res = !mpz_cmp(m, m1);
 
   mpz_clear(m1);
diff --git a/rsa.c b/rsa.c
index 74b1370af75f1e1b1967bc38b8c641e681f5851e..ae20421e89e7cb1ce7d3ee6b5556e24ee3305998 100644 (file)
--- a/rsa.c
+++ b/rsa.c
@@ -67,13 +67,6 @@ _rsa_check_size(mpz_t n)
 int
 rsa_public_key_prepare(struct rsa_public_key *key)
 {
-  /* FIXME: Add further sanity checks, like 0 < e < n. */
-#if 0
-  if ( (mpz_sgn(key->e) <= 0)
-       || mpz_cmp(key->e, key->n) >= 0)
-    return 0;
-#endif
-  
   key->size = _rsa_check_size(key->n);
   
   return (key->size > 0);
diff --git a/rsa.h b/rsa.h
index 70d8b136c3571ae91e92d0118be914327a2d1dfa..dbdace22a14ebf64b9d338e2ae3cba2c8097eb58 100644 (file)
--- a/rsa.h
+++ b/rsa.h
@@ -227,8 +227,8 @@ rsa_sha256_verify_digest(const struct rsa_public_key *key,
 
 
 /* RSA encryption, using PKCS#1 */
-/* FIXME: These functions uses the v1.5 padding. What should the v2
- * (OAEP) functions be called? */
+/* These functions uses the v1.5 padding. What should the v2 (OAEP)
+ * functions be called? */
 
 /* Returns 1 on success, 0 on failure, which happens if the
  * message is too long for the key. */
index c8ac89cd4d819d6b1907cc1e035169d09c2bdc53..db4b193472c0cd7537ffc79fd245fdc296272e6f 100644 (file)
@@ -57,9 +57,6 @@ sexp_transport_vformat(struct nettle_buffer *buffer,
 
   if (buffer)
     {
-      /* FIXME: This assumes that data is never removed from the
-       * buffer. That works for the current buffer, but it would be
-       * nice to get rid of this restriction. */
       if (!nettle_buffer_space(buffer, base64_length - length))
        return 0;
 
diff --git a/sexp.c b/sexp.c
index b1dfd2e03db8ba24bb8d357342c009b007c45a76..77b357735377217110f5731be73982a105f3a73c 100644 (file)
--- a/sexp.c
+++ b/sexp.c
@@ -50,9 +50,6 @@ sexp_iterator_init(struct sexp_iterator *iterator,
   iterator->display = NULL;
   iterator->atom_length = 0;
   iterator->atom = NULL;
-
-  /* FIXME: For other than canonical syntax,
-   * skip white space here. */
 }
 
 #define EMPTY(i) ((i)->pos == (i)->length)
diff --git a/sexp.h b/sexp.h
index d8b39bf51218553eb291d87c7be90cc83b98f6b8..53a90a14d6ef17e3d96839b8273dc899478362b1 100644 (file)
--- a/sexp.h
+++ b/sexp.h
@@ -191,9 +191,6 @@ unsigned
 sexp_vformat(struct nettle_buffer *buffer,
             const char *format, va_list args);
 
-/* FIXME: Add argument LINE_WIDTH. If non-zero, break lines to at most
- * that width. */
-
 unsigned
 sexp_transport_format(struct nettle_buffer *buffer,
                      const char *format, ...);