aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2022-07-07 15:21:06 +0200
committerMattias Andrée <maandree@kth.se>2022-07-07 15:21:06 +0200
commit2b417525c4eb152bb6f5c4bb845c3c0ecccd456e (patch)
tree5ec474f9aff7656e393ce1a2c32473ba99daa772
parentInline the output size functions (diff)
downloadlibsha2-2b417525c4eb152bb6f5c4bb845c3c0ecccd456e.tar.gz
libsha2-2b417525c4eb152bb6f5c4bb845c3c0ecccd456e.tar.bz2
libsha2-2b417525c4eb152bb6f5c4bb845c3c0ecccd456e.tar.xz
Remove documentation from .c files that already exist in .h files
Signed-off-by: Mattias Andrée <maandree@kth.se>
-rw-r--r--algorithm_output_size.c6
-rw-r--r--behex_lower.c7
-rw-r--r--behex_upper.c7
-rw-r--r--digest.c8
-rw-r--r--hmac_digest.c14
-rw-r--r--hmac_init.c9
-rw-r--r--hmac_marshal.c7
-rw-r--r--hmac_state_output_size.c6
-rw-r--r--hmac_unmarshal.c8
-rw-r--r--hmac_update.c8
-rw-r--r--init.c7
-rw-r--r--marshal.c7
-rw-r--r--process.c6
-rw-r--r--sum_fd.c9
-rw-r--r--unhex.c8
-rw-r--r--unmarshal.c8
-rw-r--r--update.c7
17 files changed, 0 insertions, 132 deletions
diff --git a/algorithm_output_size.c b/algorithm_output_size.c
index 4457c49..8f5f4e1 100644
--- a/algorithm_output_size.c
+++ b/algorithm_output_size.c
@@ -2,10 +2,4 @@
#include "common.h"
-/**
- * Get the output size of an algorithm
- *
- * @param algorithm The hashing algorithm
- * @return The number of bytes in the output, zero on error
- */
extern inline size_t libsha2_algorithm_output_size(enum libsha2_algorithm);
diff --git a/behex_lower.c b/behex_lower.c
index 6fdf474..575ff39 100644
--- a/behex_lower.c
+++ b/behex_lower.c
@@ -2,13 +2,6 @@
#include "common.h"
-/**
- * Convert a binary hashsum to lower case hexadecimal representation
- *
- * @param output Output array, should have an allocation size of at least `2 * n + 1`
- * @param hashsum The hashsum to convert
- * @param n The size of `hashsum`
- */
void
libsha2_behex_lower(char *restrict output, const void *restrict hashsum_, size_t n)
{
diff --git a/behex_upper.c b/behex_upper.c
index cfcee75..cad6778 100644
--- a/behex_upper.c
+++ b/behex_upper.c
@@ -2,13 +2,6 @@
#include "common.h"
-/**
- * Convert a binary hashsum to upper case hexadecimal representation
- *
- * @param output Output array, should have an allocation size of at least `2 * n + 1`
- * @param hashsum The hashsum to convert
- * @param n The size of `hashsum`
- */
void
libsha2_behex_upper(char *restrict output, const void *restrict hashsum_, size_t n)
{
diff --git a/digest.c b/digest.c
index 59bb680..a60da1c 100644
--- a/digest.c
+++ b/digest.c
@@ -2,14 +2,6 @@
#include "common.h"
-/**
- * Absorb the last part of the message and output a hash
- *
- * @param state The hashing state
- * @param message The message, in bits
- * @param msglen The length of the message, zero if there is nothing more to absorb
- * @param output The output buffer for the hash
- */
void
libsha2_digest(struct libsha2_state *restrict state, const void *message_, size_t msglen, void *output_)
{
diff --git a/hmac_digest.c b/hmac_digest.c
index 9cc4271..3149831 100644
--- a/hmac_digest.c
+++ b/hmac_digest.c
@@ -2,20 +2,6 @@
#include "common.h"
-/**
- * Feed data into the HMAC algorithm and
- * get the result
- *
- * The state of the algorithm will be reset and
- * `libsha2_hmac_update` and `libsha2_hmac_update`
- * can be called again
- *
- * @param state The state of the algorithm
- * @param data Data to feed into the algorithm
- * @param n The number of bytes to feed into the algorithm
- * @param output The output buffer for the hash, it will be as
- * large as for the underlaying hash algorithm
- */
void
libsha2_hmac_digest(struct libsha2_hmac_state *restrict state, const void *data, size_t n, void *output)
{
diff --git a/hmac_init.c b/hmac_init.c
index 6983073..cb47a54 100644
--- a/hmac_init.c
+++ b/hmac_init.c
@@ -2,15 +2,6 @@
#include "common.h"
-/**
- * Initialise an HMAC state
- *
- * @param state The state that should be initialised
- * @param algorithm The hashing algorithm
- * @param key The key
- * @param key_length The length of key, in bits
- * @return Zero on success, -1 on error
- */
int
libsha2_hmac_init(struct libsha2_hmac_state *restrict state, enum libsha2_algorithm algorithm,
const void *restrict key_, size_t keylen)
diff --git a/hmac_marshal.c b/hmac_marshal.c
index 2cb0816..6db8972 100644
--- a/hmac_marshal.c
+++ b/hmac_marshal.c
@@ -2,13 +2,6 @@
#include "common.h"
-/**
- * Marshal an HMAC state into a buffer
- *
- * @param state The state to marshal
- * @param buf Output buffer, `NULL` to only return the required size
- * @return The number of bytes marshalled to `buf`
- */
size_t
libsha2_hmac_marshal(const struct libsha2_hmac_state *restrict state, void *restrict buf_)
{
diff --git a/hmac_state_output_size.c b/hmac_state_output_size.c
index eff86b9..ea588c7 100644
--- a/hmac_state_output_size.c
+++ b/hmac_state_output_size.c
@@ -2,10 +2,4 @@
#include "common.h"
-/**
- * Get the output size of the algorithm specified for a HMAC state
- *
- * @param state The state
- * @return The number of bytes in the output, zero on error
- */
extern inline size_t libsha2_hmac_state_output_size(const struct libsha2_hmac_state *restrict);
diff --git a/hmac_unmarshal.c b/hmac_unmarshal.c
index df32560..197ea32 100644
--- a/hmac_unmarshal.c
+++ b/hmac_unmarshal.c
@@ -2,14 +2,6 @@
#include "common.h"
-/**
- * Unmarshal an HMAC state from a buffer
- *
- * @param state Output parameter for the unmarshalled state
- * @param buf The buffer from which the state shall be unmarshalled
- * @param bufsize The maximum number of bytes that can be unmarshalled
- * @return The number of read bytes, 0 on failure
- */
size_t
libsha2_hmac_unmarshal(struct libsha2_hmac_state *restrict state, const void *restrict buf_, size_t bufsize)
{
diff --git a/hmac_update.c b/hmac_update.c
index 245c7b1..8222bf1 100644
--- a/hmac_update.c
+++ b/hmac_update.c
@@ -2,14 +2,6 @@
#include "common.h"
-/**
- * Feed data into the HMAC algorithm
- *
- * @param state The state of the algorithm
- * @param data Data to feed into the algorithm
- * @param n The number of bytes to feed into the
- * algorithm, this must be a multiple of 8
- */
void
libsha2_hmac_update(struct libsha2_hmac_state *restrict state, const void *restrict data, size_t n)
{
diff --git a/init.c b/init.c
index 41c8473..3059ce9 100644
--- a/init.c
+++ b/init.c
@@ -78,13 +78,6 @@ static const uint64_t H_512_256[] = {
};
-/**
- * Initialise a state
- *
- * @param state The state that should be initialised
- * @param algorithm The hashing algorithm
- * @return Zero on success, -1 on error
- */
int
libsha2_init(struct libsha2_state *restrict state, enum libsha2_algorithm algorithm)
{
diff --git a/marshal.c b/marshal.c
index ba00af2..ae9ce52 100644
--- a/marshal.c
+++ b/marshal.c
@@ -2,13 +2,6 @@
#include "common.h"
-/**
- * Marshal a state into a buffer
- *
- * @param state The state to marshal
- * @param buf Output buffer, `NULL` to only return the required size
- * @return The number of bytes marshalled to `buf`
- */
size_t
libsha2_marshal(const struct libsha2_state *restrict state, void *restrict buf_)
{
diff --git a/process.c b/process.c
index 52540e0..7e3d807 100644
--- a/process.c
+++ b/process.c
@@ -55,12 +55,6 @@
h[i] += work_h[i]
-/**
- * Process a chunk using SHA-2
- *
- * @param state The hashing state
- * @param chunk The data to process
- */
void
libsha2_process(struct libsha2_state *restrict state, const unsigned char *restrict chunk)
{
diff --git a/sum_fd.c b/sum_fd.c
index f93d20c..fed3bed 100644
--- a/sum_fd.c
+++ b/sum_fd.c
@@ -2,15 +2,6 @@
#include "common.h"
-/**
- * Calculate the checksum for a file,
- * the content of the file is assumed non-sensitive
- *
- * @param fd The file descriptor of the file
- * @param algorithm The hashing algorithm
- * @param hashsum Output buffer for the hash
- * @return Zero on success, -1 on error
- */
int
libsha2_sum_fd(int fd, enum libsha2_algorithm algorithm, void *restrict hashsum)
{
diff --git a/unhex.c b/unhex.c
index 1cada1f..fd62f86 100644
--- a/unhex.c
+++ b/unhex.c
@@ -2,14 +2,6 @@
#include "common.h"
-/**
- * Convert a hexadecimal hashsum (both lower case, upper
- * case and mixed is supported) to binary representation
- *
- * @param output Output array, should have an allocation
- * size of at least `strlen(hashsum) / 2`
- * @param hashsum The hashsum to convert
- */
void
libsha2_unhex(void *restrict output_, const char *restrict hashsum)
{
diff --git a/unmarshal.c b/unmarshal.c
index 2876f31..c4b2837 100644
--- a/unmarshal.c
+++ b/unmarshal.c
@@ -2,14 +2,6 @@
#include "common.h"
-/**
- * Unmarshal a state from a buffer
- *
- * @param state Output parameter for the unmarshalled state
- * @param buf The buffer from which the state shall be unmarshalled
- * @param bufsize The maximum number of bytes that can be unmarshalled
- * @return The number of read bytes, 0 on failure
- */
size_t
libsha2_unmarshal(struct libsha2_state *restrict state, const void *restrict buf_, size_t bufsize)
{
diff --git a/update.c b/update.c
index dc78248..8d0610d 100644
--- a/update.c
+++ b/update.c
@@ -2,13 +2,6 @@
#include "common.h"
-/**
- * Absorb more of the message
- *
- * @param state The hashing state
- * @param message The message, in bits, must be equivalent to 0 modulus 8
- * @param msglen The length of the message
- */
void
libsha2_update(struct libsha2_state *restrict state, const void *restrict message_, size_t msglen)
{