Doxygen headers for libfko files

This commit is contained in:
Jonathan Bennett
2016-01-01 02:04:24 +00:00
parent dda7fa39c1
commit ae5451dccc
43 changed files with 267 additions and 276 deletions
+3 -3
View File
@@ -58,7 +58,7 @@ PROJECT_LOGO =
# entered, it will be relative to the location where doxygen was started. If
# left blank the current directory will be used.
OUTPUT_DIRECTORY = /home/oneru/src/fwknop/doc
OUTPUT_DIRECTORY = ./doc
# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-
# directories (in 2 levels) under the output directory of each output format and
@@ -763,7 +763,7 @@ WARN_FORMAT = "$file:$line: $text"
# messages should be written. If left blank the output is written to standard
# error (stderr).
WARN_LOGFILE =
WARN_LOGFILE = DoxygenWarningLog.txt
#---------------------------------------------------------------------------
# Configuration options related to the input files
@@ -775,7 +775,7 @@ WARN_LOGFILE =
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
# Note: If this tag is empty the current directory is searched.
INPUT = /home/oneru/src/fwknop
INPUT = ./
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
+6 -7
View File
@@ -1,11 +1,10 @@
/*
*****************************************************************************
/**
* \file lib/base64.c
*
* File: base64.c
*
* Purpose: Implementation of the Base64 encode/decode algorithim.
*
* This code was derived from the base64.c part of FFmpeg written
* \brief Implementation of the Base64 encode/decode algorithim.
*/
/* This code was derived from the base64.c part of FFmpeg written
* by Ryan Martell. (rdm4@martellventures.com).
*
* Copyright (C) Ryan Martell. (rdm4@martellventures.com)
+6 -7
View File
@@ -1,11 +1,10 @@
/*
*****************************************************************************
/**
* \file lib/base64.h
*
* File: base64.h
*
* Purpose: Header for the fwknop base64.c
*
* Fwknop is developed primarily by the people listed in the file 'AUTHORS'.
* \brief Header for the fwknop base64.c
*/
/* Fwknop is developed primarily by the people listed in the file 'AUTHORS'.
* Copyright (C) 2009-2015 fwknop developers and contributors. For a full
* list of contributors, see the file 'CREDITS'.
*
+6 -7
View File
@@ -1,11 +1,10 @@
/*
*****************************************************************************
/**
* \file lib/cipher_funcs.c
*
* File: cipher_funcs.c
*
* Purpose: Cipher functions used by fwknop
*
* Fwknop is developed primarily by the people listed in the file 'AUTHORS'.
* \brief Cipher functions used by fwknop
*/
/* Fwknop is developed primarily by the people listed in the file 'AUTHORS'.
* Copyright (C) 2009-2015 fwknop developers and contributors. For a full
* list of contributors, see the file 'CREDITS'.
*
+6 -7
View File
@@ -1,11 +1,10 @@
/*
*****************************************************************************
/**
* \file lib/cipher_funcs.h
*
* File: cipher_funcs.h
*
* Purpose: Header for the fwknop cipher_funcs.c.
*
* Fwknop is developed primarily by the people listed in the file 'AUTHORS'.
* \brief Header for the fwknop cipher_funcs.c.
*/
/* Fwknop is developed primarily by the people listed in the file 'AUTHORS'.
* Copyright (C) 2009-2015 fwknop developers and contributors. For a full
* list of contributors, see the file 'CREDITS'.
*
+5 -4
View File
@@ -1,9 +1,10 @@
/**
* @file digest.c
* \file lib/digest.c
*
* @brief Roll-up of the digests used by fwknop.
*
* Fwknop is developed primarily by the people listed in the file 'AUTHORS'.
* \brief Roll-up of the digests used by fwknop.
*/
/* Fwknop is developed primarily by the people listed in the file 'AUTHORS'.
* Copyright (C) 2009-2015 fwknop developers and contributors. For a full
* list of contributors, see the file 'CREDITS'.
*
+6 -7
View File
@@ -1,11 +1,10 @@
/*
*****************************************************************************
/**
* \file lib/digest.h
*
* File: digest.h
*
* Purpose: Header for the fwknop digest.c.
*
* Fwknop is developed primarily by the people listed in the file 'AUTHORS'.
* \brief Header for the fwknop digest.c.
*/
/* Fwknop is developed primarily by the people listed in the file 'AUTHORS'.
* Copyright (C) 2009-2015 fwknop developers and contributors. For a full
* list of contributors, see the file 'CREDITS'.
*
+1 -1
View File
@@ -1,5 +1,5 @@
/**
* \file fko.h
* \file lib/fko.h
*
* \brief Header for libfko
*/
+6 -7
View File
@@ -1,11 +1,10 @@
/*
*****************************************************************************
/**
* \file lib/fko_client_timeout.c
*
* File: fko_spa_client_timeout.c
*
* Purpose: Set/Get the spa client timeout data
*
* Fwknop is developed primarily by the people listed in the file 'AUTHORS'.
* \brief Set/Get the spa client timeout data
*/
/* Fwknop is developed primarily by the people listed in the file 'AUTHORS'.
* Copyright (C) 2009-2015 fwknop developers and contributors. For a full
* list of contributors, see the file 'CREDITS'.
*
+6 -7
View File
@@ -1,11 +1,10 @@
/*
*****************************************************************************
/**
* \file lib/fko_common.h
*
* File: fko_common.h
*
* Purpose: Common header for libfko source files.
*
* Fwknop is developed primarily by the people listed in the file 'AUTHORS'.
* \brief Common header for libfko source files.
*/
/* Fwknop is developed primarily by the people listed in the file 'AUTHORS'.
* Copyright (C) 2009-2015 fwknop developers and contributors. For a full
* list of contributors, see the file 'CREDITS'.
*
+1 -2
View File
@@ -1,6 +1,5 @@
/**
*
* \file fko_context.h
* \file lib/fko_context.h
*
* \brief fko context definiton.
*/
+6 -7
View File
@@ -1,11 +1,10 @@
/*
*****************************************************************************
/**
* \file lib/fko_decode.c
*
* File: fko_decode.c
*
* Purpose: Decode an FKO SPA message after decryption.
*
* Fwknop is developed primarily by the people listed in the file 'AUTHORS'.
* \brief Decode an FKO SPA message after decryption.
*/
/* Fwknop is developed primarily by the people listed in the file 'AUTHORS'.
* Copyright (C) 2009-2015 fwknop developers and contributors. For a full
* list of contributors, see the file 'CREDITS'.
*
+6 -7
View File
@@ -1,13 +1,12 @@
/*
*****************************************************************************
/**
* \file lib/fko_digest.c
*
* File: fko_digest.c
*
* Purpose: Create the base64-encoded digest for the current spa data. The
* \brief Create the base64-encoded digest for the current spa data. The
* digest used is determined by the digest_type setting in the
* fko context.
*
* Fwknop is developed primarily by the people listed in the file 'AUTHORS'.
*/
/* Fwknop is developed primarily by the people listed in the file 'AUTHORS'.
* Copyright (C) 2009-2015 fwknop developers and contributors. For a full
* list of contributors, see the file 'CREDITS'.
*
+6 -7
View File
@@ -1,13 +1,12 @@
/*
*****************************************************************************
/**
* \file lib/fko_encode.c
*
* File: fko_encode.c
*
* Purpose: Encodes some pieces of the spa data then puts together all of
* \brief Encodes some pieces of the spa data then puts together all of
* the necessary pieces to gether to create the single encoded
* message string.
*
* Fwknop is developed primarily by the people listed in the file 'AUTHORS'.
*/
/* Fwknop is developed primarily by the people listed in the file 'AUTHORS'.
* Copyright (C) 2009-2015 fwknop developers and contributors. For a full
* list of contributors, see the file 'CREDITS'.
*
+6 -7
View File
@@ -1,11 +1,10 @@
/*
*****************************************************************************
/**
* \file lib/fko_encryption.c
*
* File: fko_encryption.c
*
* Purpose: Set/Get the spa encryption type.
*
* Fwknop is developed primarily by the people listed in the file 'AUTHORS'.
* \brief Set/Get the spa encryption type.
*/
/* Fwknop is developed primarily by the people listed in the file 'AUTHORS'.
* Copyright (C) 2009-2015 fwknop developers and contributors. For a full
* list of contributors, see the file 'CREDITS'.
*
+6 -7
View File
@@ -1,11 +1,10 @@
/*
*****************************************************************************
/**
* \file lib/fko_error.c
*
* File: fko_error.c
*
* Purpose: Error handling functions for libfko
*
* Fwknop is developed primarily by the people listed in the file 'AUTHORS'.
* \brief Error handling functions for libfko
*/
/* Fwknop is developed primarily by the people listed in the file 'AUTHORS'.
* Copyright (C) 2009-2015 fwknop developers and contributors. For a full
* list of contributors, see the file 'CREDITS'.
*
+6 -7
View File
@@ -1,11 +1,10 @@
/*
*****************************************************************************
/**
* \file lib/fko_funcs.c
*
* File: fko_funcs.c
*
* Purpose: General utility functions for libfko
*
* Fwknop is developed primarily by the people listed in the file 'AUTHORS'.
* \brief General utility functions for libfko
*/
/* Fwknop is developed primarily by the people listed in the file 'AUTHORS'.
* Copyright (C) 2009-2015 fwknop developers and contributors. For a full
* list of contributors, see the file 'CREDITS'.
*
+6 -7
View File
@@ -1,11 +1,10 @@
/*
*****************************************************************************
/**
* \file lib/fko_hmac.c
*
* File: fko_hmac.c
*
* Purpose: Provide HMAC support to SPA communications
*
* Fwknop is developed primarily by the people listed in the file 'AUTHORS'.
* \brief Provide HMAC support to SPA communications
*/
/* Fwknop is developed primarily by the people listed in the file 'AUTHORS'.
* Copyright (C) 2009-2015 fwknop developers and contributors. For a full
* list of contributors, see the file 'CREDITS'.
*
+6 -5
View File
@@ -1,9 +1,10 @@
/*
*****************************************************************************
/**
* \file lib/fko_limits.h
*
* File: fko_limits.h
*
* Fwknop is developed primarily by the people listed in the file 'AUTHORS'.
* \brief #defines for libfko limits
*/
/* Fwknop is developed primarily by the people listed in the file 'AUTHORS'.
* Copyright (C) 2009-2015 fwknop developers and contributors. For a full
* list of contributors, see the file 'CREDITS'.
*
+6 -8
View File
@@ -1,12 +1,10 @@
/*
*****************************************************************************
/**
* \file lib/fko_message.c
*
* File: fko_message.c
*
* Purpose: Set/Get the spa message (access req/command/etc) based
* on the current spa data.
*
* Fwknop is developed primarily by the people listed in the file 'AUTHORS'.
* \brief Set/Get the spa message (access req/command/etc) based on the current spa data.
*/
/* Fwknop is developed primarily by the people listed in the file 'AUTHORS'.
* Copyright (C) 2009-2015 fwknop developers and contributors. For a full
* list of contributors, see the file 'CREDITS'.
*
+6 -7
View File
@@ -1,11 +1,10 @@
/*
*****************************************************************************
/**
* \file lib/fko_message.h
*
* File: fko_message.h
*
* Purpose: Provide validation functions for SPA messages
*
* Fwknop is developed primarily by the people listed in the file 'AUTHORS'.
* \brief Provide validation functions for SPA messages
*/
/* Fwknop is developed primarily by the people listed in the file 'AUTHORS'.
* Copyright (C) 2009-2015 fwknop developers and contributors. For a full
* list of contributors, see the file 'CREDITS'.
*
+6 -7
View File
@@ -1,11 +1,10 @@
/*
*****************************************************************************
/**
* \file lib/fko_nat_access.c
*
* File: fko_nat_access.c
*
* Purpose: Set/Get the spa nat access request data.
*
* Fwknop is developed primarily by the people listed in the file 'AUTHORS'.
* \brief Set/Get the spa nat access request data.
*/
/* Fwknop is developed primarily by the people listed in the file 'AUTHORS'.
* Copyright (C) 2009-2015 fwknop developers and contributors. For a full
* list of contributors, see the file 'CREDITS'.
*
+6 -7
View File
@@ -1,11 +1,10 @@
/*
*****************************************************************************
/**
* \file lib/fko_rand_value.c
*
* File: fko_rand_value.c
*
* Purpose: Generate a 16-byte random numeric value.
*
* Fwknop is developed primarily by the people listed in the file 'AUTHORS'.
* \ Generate a 16-byte random numeric value.
*/
/* Fwknop is developed primarily by the people listed in the file 'AUTHORS'.
* Copyright (C) 2009-2015 fwknop developers and contributors. For a full
* list of contributors, see the file 'CREDITS'.
*
+6 -7
View File
@@ -1,11 +1,10 @@
/*
*****************************************************************************
/**
* \file lib/fko_server_auth.c
*
* File: fko_server_auth.c
*
* Purpose: Set/Get the spa server auth data.
*
* Fwknop is developed primarily by the people listed in the file 'AUTHORS'.
* \brief Set/Get the spa server auth data.
*/
/* Fwknop is developed primarily by the people listed in the file 'AUTHORS'.
* Copyright (C) 2009-2015 fwknop developers and contributors. For a full
* list of contributors, see the file 'CREDITS'.
*
+6 -7
View File
@@ -1,11 +1,10 @@
/*
*****************************************************************************
/**
* \file lib/fko_state.h
*
* File: fko_state.h
*
* Purpose: Defines various states and flags for libfko operations.
*
* Fwknop is developed primarily by the people listed in the file 'AUTHORS'.
* \brief Defines various states and flags for libfko operations.
*/
/* Fwknop is developed primarily by the people listed in the file 'AUTHORS'.
* Copyright (C) 2009-2015 fwknop developers and contributors. For a full
* list of contributors, see the file 'CREDITS'.
*
+6 -7
View File
@@ -1,11 +1,10 @@
/*
*****************************************************************************
/**
* \file lib/fko_timestamp.c
*
* File: fko_timestamp.c
*
* Purpose: Get the current timestamp with optional offset applied.
*
* Fwknop is developed primarily by the people listed in the file 'AUTHORS'.
* \brief Get the current timestamp with optional offset applied.
*/
/* Fwknop is developed primarily by the people listed in the file 'AUTHORS'.
* Copyright (C) 2009-2015 fwknop developers and contributors. For a full
* list of contributors, see the file 'CREDITS'.
*
+6 -7
View File
@@ -1,11 +1,10 @@
/*
*****************************************************************************
/**
* \file lib/fko_user.c
*
* File: fko_user.c
*
* Purpose: Set/Get the current username.
*
* Fwknop is developed primarily by the people listed in the file 'AUTHORS'.
* \brief Set/Get the current username.
*/
/* Fwknop is developed primarily by the people listed in the file 'AUTHORS'.
* Copyright (C) 2009-2015 fwknop developers and contributors. For a full
* list of contributors, see the file 'CREDITS'.
*
+6 -7
View File
@@ -1,11 +1,10 @@
/*
*****************************************************************************
/**
* \file lib/fko_user.h
*
* File: fko_user.h
*
* Purpose: Provide validation functions for SPA messages
*
* Fwknop is developed primarily by the people listed in the file 'AUTHORS'.
* \brief Provide validation functions for SPA messages
*/
/* Fwknop is developed primarily by the people listed in the file 'AUTHORS'.
* Copyright (C) 2009-2015 fwknop developers and contributors. For a full
* list of contributors, see the file 'CREDITS'.
*
+6
View File
@@ -1,3 +1,9 @@
/**
* \file lib/fko_utests.c
*
* \brief Main CUnit test function for libfko
*/
#include "CUnit/Basic.h"
#include "fko.h"
+6 -7
View File
@@ -1,11 +1,10 @@
/*
*****************************************************************************
/**
* \file lib/gpgme_funcs.c
*
* File: gpgme_funcs.c
*
* Purpose: gpgme-related functions for GPG encryptions support in libfko.
*
* Fwknop is developed primarily by the people listed in the file 'AUTHORS'.
* \brief gpgme-related functions for GPG encryptions support in libfko.
*/
/* Fwknop is developed primarily by the people listed in the file 'AUTHORS'.
* Copyright (C) 2009-2015 fwknop developers and contributors. For a full
* list of contributors, see the file 'CREDITS'.
*
+6 -7
View File
@@ -1,11 +1,10 @@
/*
*****************************************************************************
/**
* \file lib/gpgme_funcs.h
*
* File: gpgme_funcs.h
*
* Purpose: Header for the fwknop gpgme_funcs.c.
*
* Fwknop is developed primarily by the people listed in the file 'AUTHORS'.
* \brief Header for the fwknop gpgme_funcs.c.
*/
/* Fwknop is developed primarily by the people listed in the file 'AUTHORS'.
* Copyright (C) 2009-2015 fwknop developers and contributors. For a full
* list of contributors, see the file 'CREDITS'.
*
+6 -7
View File
@@ -1,11 +1,10 @@
/*
*****************************************************************************
/**
* \file lib/hmac.c
*
* File: fko_hmac.c
*
* Purpose: Provide HMAC support to SPA communications
*
* Fwknop is developed primarily by the people listed in the file 'AUTHORS'.
* \brief Provide HMAC support to SPA communications
*/
/* Fwknop is developed primarily by the people listed in the file 'AUTHORS'.
* Copyright (C) 2009-2015 fwknop developers and contributors. For a full
* list of contributors, see the file 'CREDITS'.
*
+6 -7
View File
@@ -1,11 +1,10 @@
/*
*****************************************************************************
/**
* \file lib/hmac.h
*
* File: hmac.h
*
* Purpose: Provide HMAC support for SPA communications
*
* Fwknop is developed primarily by the people listed in the file 'AUTHORS'.
* \brief Provide HMAC support for SPA communications
*/
/* Fwknop is developed primarily by the people listed in the file 'AUTHORS'.
* Copyright (C) 2009-2015 fwknop developers and contributors. For a full
* list of contributors, see the file 'CREDITS'.
*
+6 -7
View File
@@ -1,11 +1,10 @@
/*
*****************************************************************************
/**
* \file lib/md5.c
*
* File: md5.c
*
* Purpose: Implementation of the MD5 message-digest algorithm for libfwknop.
*
* This code implements the MD5 message-digest algorithm.
* \brief Implementation of the MD5 message-digest algorithm for libfwknop.
*/
/* This code implements the MD5 message-digest algorithm.
*
* The algorithm is due to Ron Rivest. This code was
* written by Colin Plumb in 1993, no copyright is claimed.
+6 -7
View File
@@ -1,11 +1,10 @@
/*
*****************************************************************************
/**
* \file lib/md5.h
*
* File: md5.h
*
* Purpose: Header for the fwknop md5.c.
*
* MD5 Message Digest Algorithm (RFC1321).
* \brief Header for the fwknop md5.c.
*/
/* MD5 Message Digest Algorithm (RFC1321).
*
* Derived from cryptoapi implementation, originally based on the
* public domain implementation written by Colin Plumb in 1993.
+6 -7
View File
@@ -1,11 +1,10 @@
/*
*****************************************************************************
/**
* \file lib/rijndael.c
*
* File: rijndael.c
*
* Purpose: rijndael - An implementation of the Rijndael cipher.
*
* Copyright (C) 2000, 2001 Rafael R. Sevilla <sevillar@team.ph.inter.net>
* \brief rijndael - An implementation of the Rijndael cipher.
*/
/* Copyright (C) 2000, 2001 Rafael R. Sevilla <sevillar@team.ph.inter.net>
*
* Currently maintained by brian d foy, <bdfoy@cpan.org>
*
+10 -7
View File
@@ -1,10 +1,10 @@
/**
* \file lib/rijndael.h
*
* \brief rijndael - An implementation of the Rijndael cipher.
*/
/*
*****************************************************************************
*
* File: rigndael.c
*
* Purpose: rijndael - An implementation of the Rijndael cipher.
*
* Copyright (C) 2000, 2001 Rafael R. Sevilla <sevillar@team.ph.inter.net>
*
* Currently maintained by brian d foy, <bdfoy@cpan.org>
@@ -67,7 +67,10 @@ typedef struct {
uint8_t salt[SALT_LEN];
} RIJNDAEL_context;
/* This basically performs Rijndael's key scheduling algorithm, as it's the
/**
* \brief initialize a Rijndael context with key
*
* This basically performs Rijndael's key scheduling algorithm, as it's the
* only initialization required anyhow. The key size is specified in bytes,
* but the only valid values are 16 (128 bits), 24 (192 bits), and 32 (256
* bits). If a value other than these three is specified, the key will be
+7 -9
View File
@@ -1,12 +1,10 @@
/*
*****************************************************************************
/**
* \file lib/sha1.c
*
* File: sha1.c
*
* Purpose: Implementation of the SHA1 message-digest algorithm for
* libfwknop.
*
* NIST Secure Hash Algorithm
* \brief Implementation of the SHA1 message-digest algorithm for libfwknop.
*/
/* NIST Secure Hash Algorithm
* Heavily modified by Uwe Hollerbach <uh@alumni.caltech edu>
* from Peter C. Gutmann's implementation as found in
* Applied Cryptography by Bruce Schneier
@@ -78,7 +76,7 @@ sha1_transform(SHA1_INFO *sha1_info)
for (i = 0; i < 16; ++i) {
T = *((uint32_t *) dp);
dp += 4;
W[i] =
W[i] =
((T << 24) & 0xff000000) |
((T << 8) & 0x00ff0000) |
((T >> 8) & 0x0000ff00) | ((T >> 24) & 0x000000ff);
+6 -7
View File
@@ -1,11 +1,10 @@
/*
*****************************************************************************
/**
* \file lib/sha1.h
*
* File: sha1.h
*
* Purpose: Header for sha1.c
*
* sha - An implementation of the NIST SHA1 Message Digest
* \brief Header for sha1.c
*/
/* sha - An implementation of the NIST SHA1 Message Digest
* algorithm.
*
* Copyright (C) 2001 Rafael R. Sevilla <sevillar@team.ph.inter.net>
+10 -11
View File
@@ -1,11 +1,10 @@
/*
*****************************************************************************
/**
* \file lib/sha2.c
*
* File: sha2.c
*
* Purpose: An implementation of the SHA 26/384/512 digests.
*
* AUTHOR: Aaron D. Gifford - http://www.aarongifford.com/
* \brief An implementation of the SHA 26/384/512 digests.
*/
/* AUTHOR: Aaron D. Gifford - http://www.aarongifford.com/
*
* Copyright (c) 2000-2001, Aaron D. Gifford
*
@@ -22,7 +21,7 @@
* 3. Neither the name of the copyright holder nor the names of contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTOR(S) ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -83,7 +82,7 @@
*
* And for little-endian machines, add:
*
* #define BYTE_ORDER LITTLE_ENDIAN
* #define BYTE_ORDER LITTLE_ENDIAN
*
* Or for big-endian machines:
*
@@ -496,11 +495,11 @@ void SHA256_Transform(SHA256_CTX* context, const sha2_word32* data) {
/* Part of the message block expansion: */
s0 = W256[(j+1)&0x0f];
s0 = sigma0_256(s0);
s1 = W256[(j+14)&0x0f];
s1 = W256[(j+14)&0x0f];
s1 = sigma1_256(s1);
/* Apply the SHA-256 compression function to update a..h */
T1 = h + Sigma1_256(e) + Ch(e, f, g) + K256[j] +
T1 = h + Sigma1_256(e) + Ch(e, f, g) + K256[j] +
(W256[j&0x0f] += s1 + W256[(j+9)&0x0f] + s0);
T2 = Sigma0_256(a) + Maj(a, b, c);
h = g;
+8 -10
View File
@@ -1,12 +1,11 @@
/*
*****************************************************************************
/**
* \file lib/sha2.h
*
* File: sha2.h
* \brief Header for sha2.c - Implementation of the SHA 26/384/512 digests.
*/
/* AUTHOR: Aaron D. Gifford - http://www.aarongifford.com/
*
* Purpose: Header for sha2.c - Implementation of the SHA 26/384/512 digests.
*
* AUTHOR: Aaron D. Gifford - http://www.aarongifford.com/
*
* Copyright (c) 2000-2001, Aaron D. Gifford
* All rights reserved.
*
@@ -21,7 +20,7 @@
* 3. Neither the name of the copyright holder nor the names of contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTOR(S) ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -101,7 +100,7 @@ typedef unsigned long long u_int64_t; /* 8-bytes (64-bits) */
*
* #include <inttypes.h>
*
* If you choose to use <inttypes.h> then please define:
* If you choose to use <inttypes.h> then please define:
*
* #define SHA2_USE_INTTYPES_H
*
@@ -193,4 +192,3 @@ void SHA512_Final();
#endif /* __cplusplus */
#endif /* __SHA2_H__ */
+6
View File
@@ -1,3 +1,9 @@
/**
* \file lib/sha3.c
*
* \brief Implementation of SHA3
*/
/*
Implementation by the Keccak, Keyak and Ketje Teams, namely, Guido Bertoni,
Joan Daemen, Michaël Peeters, Gilles Van Assche and Ronny Van Keer, hereby
+18 -6
View File
@@ -1,3 +1,11 @@
/**
* \file lib/sha3.h
*
* \brief header file for SHA3 routines
*/
#define SHA3_256_DIGEST_LEN 32
#define SHA3_512_DIGEST_LEN 64
#define SHA3_256_BLOCK_LEN 136
@@ -10,31 +18,35 @@
void Keccak(unsigned int rate, unsigned int capacity, const unsigned char *input, unsigned long long int inputByteLen, unsigned char delimitedSuffix, unsigned char *output, unsigned long long int outputByteLen);
/**
* Function to compute SHAKE128 on the input message with any output length.
* \brief Function to compute SHAKE128 on the input message with any output length.
*
* Not currently in use
*/
void FIPS202_SHAKE128(const unsigned char *input, unsigned int inputByteLen, unsigned char *output, int outputByteLen);
/**
* Function to compute SHAKE256 on the input message with any output length.
* \brief Function to compute SHAKE256 on the input message with any output length.
*
* Not currently in use
*/
void FIPS202_SHAKE256(const unsigned char *input, unsigned int inputByteLen, unsigned char *output, int outputByteLen);
/**
* Function to compute SHA3-224 on the input message. The output length is fixed to 28 bytes.
* \brief Function to compute SHA3-224 on the input message. The output length is fixed to 28 bytes.
*/
void FIPS202_SHA3_224(const unsigned char *input, unsigned int inputByteLen, unsigned char *output);
/**
* Function to compute SHA3-256 on the input message. The output length is fixed to 32 bytes.
* \brief Function to compute SHA3-256 on the input message. The output length is fixed to 32 bytes.
*/
void FIPS202_SHA3_256(const unsigned char *input, unsigned int inputByteLen, unsigned char *output);
/**
* Function to compute SHA3-384 on the input message. The output length is fixed to 48 bytes.
* \brief Function to compute SHA3-384 on the input message. The output length is fixed to 48 bytes.
*/
void FIPS202_SHA3_384(const unsigned char *input, unsigned int inputByteLen, unsigned char *output);
/**
* Function to compute SHA3-512 on the input message. The output length is fixed to 64 bytes.
* \brief Function to compute SHA3-512 on the input message. The output length is fixed to 64 bytes.
*/
void FIPS202_SHA3_512(const unsigned char *input, unsigned int inputByteLen, unsigned char *output);