Commit f640b828 authored by Niels Möller's avatar Niels Möller

Reviewed FIXME-comments.

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
parent 911efe12
...@@ -59,9 +59,9 @@ _nettle_aes_decrypt(const struct aes_ctx *ctx, ...@@ -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]); 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]); t3 = AES_ROUND(T, w3, w2, w1, w0, ctx->keys[4*round + 3]);
/* FIXME: We could unrolling the loop twice, to avoid these /* We could unroll the loop twice, to avoid these
assignments. If all eight variables fit in registers, that assignments. If all eight variables fit in registers,
should give a speedup. */ that should give a slight speedup. */
w0 = t0; w0 = t0;
w1 = t1; w1 = t1;
w2 = t2; w2 = t2;
......
...@@ -59,9 +59,9 @@ _nettle_aes_encrypt(const struct aes_ctx *ctx, ...@@ -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]); 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]); t3 = AES_ROUND(T, w3, w0, w1, w2, ctx->keys[4*round + 3]);
/* FIXME: We could unrolling the loop twice, to avoid these /* We could unroll the loop twice, to avoid these
assignments. If all eight variables fit in registers, that assignments. If all eight variables fit in registers,
should give a speedup. */ that should give a slight speedup. */
w0 = t0; w0 = t0;
w1 = t1; w1 = t1;
w2 = t2; w2 = t2;
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
#define _aes_decrypt _nettle_aes_decrypt #define _aes_decrypt _nettle_aes_decrypt
#define _aes_encrypt_table _nettle_aes_encrypt_table #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 #ifndef AES_SMALL
# define AES_SMALL 0 # define AES_SMALL 0
#endif #endif
......
...@@ -64,8 +64,6 @@ void ...@@ -64,8 +64,6 @@ void
arctwo_set_key (struct arctwo_ctx *ctx, unsigned length, const uint8_t *key); arctwo_set_key (struct arctwo_ctx *ctx, unsigned length, const uint8_t *key);
/* Equvivalent to arctwo_set_key_ekb, with ekb = 1024 */ /* 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 void
arctwo_set_key_gutmann (struct arctwo_ctx *ctx, arctwo_set_key_gutmann (struct arctwo_ctx *ctx,
unsigned length, const uint8_t *key); unsigned length, const uint8_t *key);
......
...@@ -65,7 +65,6 @@ base16_decode_single(struct base16_decode_ctx *ctx, ...@@ -65,7 +65,6 @@ base16_decode_single(struct base16_decode_ctx *ctx,
if (src >= 0x80) if (src >= 0x80)
return -1; return -1;
/* FIXME: This code could use more clever choices of constants. */
digit = hex_decode_table[src]; digit = hex_decode_table[src];
switch (digit) switch (digit)
{ {
......
...@@ -35,7 +35,6 @@ hex_digits[16] = "0123456789abcdef"; ...@@ -35,7 +35,6 @@ hex_digits[16] = "0123456789abcdef";
#define DIGIT(x) (hex_digits[(x) & 0xf]) #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]. */ /* Encodes a single byte. Always stores two digits in dst[0] and dst[1]. */
void void
base16_encode_single(uint8_t *dst, base16_encode_single(uint8_t *dst,
......
...@@ -86,8 +86,8 @@ base16_decode_single(struct base16_decode_ctx *ctx, ...@@ -86,8 +86,8 @@ base16_decode_single(struct base16_decode_ctx *ctx,
* area before the call. *DST_LENGTH is updated to the amount of * area before the call. *DST_LENGTH is updated to the amount of
* decoded output. */ * decoded output. */
/* FIXME: Currently results in an assertion failure if *DST_LENGTH is /* Currently results in an assertion failure if *DST_LENGTH is
* too small. Return some error instead? */ * too small. FIXME: Return some error instead? */
int int
base16_decode_update(struct base16_decode_ctx *ctx, base16_decode_update(struct base16_decode_ctx *ctx,
unsigned *dst_length, unsigned *dst_length,
......
...@@ -133,8 +133,8 @@ base64_decode_single(struct base64_decode_ctx *ctx, ...@@ -133,8 +133,8 @@ base64_decode_single(struct base64_decode_ctx *ctx,
* area before the call. *DST_LENGTH is updated to the amount of * area before the call. *DST_LENGTH is updated to the amount of
* decoded output. */ * decoded output. */
/* FIXME: Currently results in an assertion failure if *DST_LENGTH is /* Currently results in an assertion failure if *DST_LENGTH is
* too small. Return some error instead? */ * too small. FIXME: Return some error instead? */
int int
base64_decode_update(struct base64_decode_ctx *ctx, base64_decode_update(struct base64_decode_ctx *ctx,
unsigned *dst_length, unsigned *dst_length,
......
...@@ -57,8 +57,8 @@ nettle_mpz_random(mpz_t x, ...@@ -57,8 +57,8 @@ nettle_mpz_random(mpz_t x,
void *ctx, nettle_random_func random, void *ctx, nettle_random_func random,
const mpz_t n) const mpz_t n)
{ {
/* FIXME: This leaves some bias, which may be bad for DSA. A better /* NOTE: This leaves some bias, which may be bad for DSA. A better
* way might to generate a random number of mpz_sizeinbase(n, 2) * way might be to generate a random number of mpz_sizeinbase(n, 2)
* bits, and loop until one smaller than n is found. */ * bits, and loop until one smaller than n is found. */
/* From Daniel Bleichenbacher (via coderpunks): /* From Daniel Bleichenbacher (via coderpunks):
......
...@@ -120,9 +120,6 @@ nettle_mpz_get_str_256(unsigned length, uint8_t *s, const mpz_t x) ...@@ -120,9 +120,6 @@ nettle_mpz_get_str_256(unsigned length, uint8_t *s, const mpz_t x)
mpz_init(c); mpz_init(c);
mpz_com(c, x); 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); assert(nettle_mpz_sizeinbase_256_u(c) <= length);
nettle_mpz_to_octets(length, s, c, 0xff); nettle_mpz_to_octets(length, s, c, 0xff);
......
...@@ -46,7 +46,6 @@ nettle_mpz_sizeinbase_256_u(const mpz_t x); ...@@ -46,7 +46,6 @@ nettle_mpz_sizeinbase_256_u(const mpz_t x);
/* Writes an integer as length octets, using big endian byte order, /* Writes an integer as length octets, using big endian byte order,
* and two's complement for negative numbers. */ * and two's complement for negative numbers. */
/* FIXME: Change order of arguments, putting the mpz_t first? */
void void
nettle_mpz_get_str_256(unsigned length, uint8_t *s, const mpz_t x); nettle_mpz_get_str_256(unsigned length, uint8_t *s, const mpz_t x);
......
...@@ -60,8 +60,6 @@ rsa_private_key_clear(struct rsa_private_key *key) ...@@ -60,8 +60,6 @@ rsa_private_key_clear(struct rsa_private_key *key)
int int
rsa_private_key_prepare(struct rsa_private_key *key) rsa_private_key_prepare(struct rsa_private_key *key)
{ {
/* FIXME: Add further sanity checks. */
mpz_t n; mpz_t n;
/* The size of the product is the sum of the sizes of the factors, /* The size of the product is the sum of the sizes of the factors,
......
...@@ -48,7 +48,6 @@ _rsa_verify(const struct rsa_public_key *key, ...@@ -48,7 +48,6 @@ _rsa_verify(const struct rsa_public_key *key,
mpz_powm(m1, s, key->e, key->n); 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); res = !mpz_cmp(m, m1);
mpz_clear(m1); mpz_clear(m1);
......
...@@ -67,13 +67,6 @@ _rsa_check_size(mpz_t n) ...@@ -67,13 +67,6 @@ _rsa_check_size(mpz_t n)
int int
rsa_public_key_prepare(struct rsa_public_key *key) 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); key->size = _rsa_check_size(key->n);
return (key->size > 0); return (key->size > 0);
......
...@@ -227,8 +227,8 @@ rsa_sha256_verify_digest(const struct rsa_public_key *key, ...@@ -227,8 +227,8 @@ rsa_sha256_verify_digest(const struct rsa_public_key *key,
/* RSA encryption, using PKCS#1 */ /* RSA encryption, using PKCS#1 */
/* FIXME: These functions uses the v1.5 padding. What should the v2 /* These functions uses the v1.5 padding. What should the v2 (OAEP)
* (OAEP) functions be called? */ * functions be called? */
/* Returns 1 on success, 0 on failure, which happens if the /* Returns 1 on success, 0 on failure, which happens if the
* message is too long for the key. */ * message is too long for the key. */
......
...@@ -57,9 +57,6 @@ sexp_transport_vformat(struct nettle_buffer *buffer, ...@@ -57,9 +57,6 @@ sexp_transport_vformat(struct nettle_buffer *buffer,
if (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)) if (!nettle_buffer_space(buffer, base64_length - length))
return 0; return 0;
......
...@@ -50,9 +50,6 @@ sexp_iterator_init(struct sexp_iterator *iterator, ...@@ -50,9 +50,6 @@ sexp_iterator_init(struct sexp_iterator *iterator,
iterator->display = NULL; iterator->display = NULL;
iterator->atom_length = 0; iterator->atom_length = 0;
iterator->atom = NULL; iterator->atom = NULL;
/* FIXME: For other than canonical syntax,
* skip white space here. */
} }
#define EMPTY(i) ((i)->pos == (i)->length) #define EMPTY(i) ((i)->pos == (i)->length)
......
...@@ -191,9 +191,6 @@ unsigned ...@@ -191,9 +191,6 @@ unsigned
sexp_vformat(struct nettle_buffer *buffer, sexp_vformat(struct nettle_buffer *buffer,
const char *format, va_list args); const char *format, va_list args);
/* FIXME: Add argument LINE_WIDTH. If non-zero, break lines to at most
* that width. */
unsigned unsigned
sexp_transport_format(struct nettle_buffer *buffer, sexp_transport_format(struct nettle_buffer *buffer,
const char *format, ...); const char *format, ...);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment