X-Git-Url: https://git.distorted.org.uk/~mdw/catacomb/blobdiff_plain/0f00dc4c8eb47e67bc0f148c2dd109f73a451e0a..1b420890ac399d1844ab6c4fe0e0e22ba8fbe3ad:/symm/des.h diff --git a/symm/des.h b/symm/des.h index 682be6b0..6f5ebbe8 100644 --- a/symm/des.h +++ b/symm/des.h @@ -66,6 +66,23 @@ typedef struct des_ctx { /*----- Functions provided ------------------------------------------------*/ +/* --- @des_fixparity@ --- * + * + * Arguments: @octet *z@ = output buffer pointer, or null + * @const octet *p@ = input buffer pointer + * @size_t sz@ = size of the buffers + * + * Returns: Zero if the input already had correct parity, @-1@ if changes + * were necessary (in constant time). + * + * Use: Check the @sz@ bytes at @p@ for odd parity (as used in DES + * keys); if @z@ is not null, then copy a parity-fixed version + * of @p@ to @z@. The two buffers at @p@ and @z@ may coincide, + * or be disjoint, but not otherwise overlap. + */ + +extern int des_fixparity(octet */*z*/, const octet */*p*/, size_t /*sz*/); + /* --- @des_expand@ --- * * * Arguments: @const octet *k@ = pointer to key material