Skip to content

Minor documentation and formatting fixes #799

Description

@headscott

I noticed a few small typos, documentation inconsistencies, and formatting issues.
These are all minor cleanup items, but fixing them would improve consistency and readability:

  • ltc_pkcs_1_pss_encode_mgf1.c:72: remove the unnecessary blank line
  • hmac_init.c:67: remove extra spaces
  • hash_memory.c: hash_descriptor[hash].hashsize is accessed multiple times. It could be stored in a local variable (like in hmac_done.c) after validating the hash, and then reused throughout the function:
unsigned long hashsize;

/* ... */

if ((err = hash_is_valid(hash)) != CRYPT_OK) {
    return err;
}

hashsize = hash_descriptor[hash].hashsize;
  • der_decode_choice.c:111+112: align the calculation lines
  • der_decode_integer.c:75: remove the unnecessary blank line
  • der_decode_short_integer.c:62: remove the unnecessary blank line
  • der_decode_utctime.c:74-81: align the comment
  • der_decode_generalizedtime.c:91-98: align the comment
  • s_der_decode_sequence_flexi.c: The XMALLOC, XCALLOC and XREALLOC calls use a code style that differs from the rest of the codebase. I would prefer to write them as separate assignment and NULL-check statements, for example:
             l->data = XMALLOC(len);
             if(l->data == NULL) {
                err = CRYPT_MEM;
                goto error;
             }

instead of:

             if ((l->data = XMALLOC(len)) == NULL) {
                err = CRYPT_MEM;
                goto error;
             }

Activity

  1. karel-m commented on Aug 31, 2026

    @karel-m
    Member

    I am not sure about changing "separate assignment + NULL-check" the rest is fixed in #800

  2. added a commit that references this issue on Sep 1, 2026
    267fcbc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions