nuttx-mirror/include/crypto/md5.h
Alin Jerpelea 7e74a0b8fa include/crypto/md5: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

define NuttX local NuttX-PublicDomain identifier

 “Public Domain” is a concept distinct from copyright licensing;
it generally means that the work no longer has any copyright protection
or ownership, and therefore requires no license permission in order to
use, copy, modify, distribute, perform, display, etc.
In the United States – and many jurisdictions – copyright protections
attach automatically to creative works upon creation if they satisfy
certain minimum criteria.
“Public Domain” would thus represent a significant change to the legal
status of the work.
The rules around “Public Domain” often vary or are unspecified
jurisdiction to jurisdiction. Adding to the confusion, some
jurisdictions may not even recognize the concept of “Public Domain”
(or similar). As such, a license may nevertheless be required or implied
in these cases. Even in the U.S., there is no clear,
officially-sanctioned procedure for affirmatively placing
copyright-eligible works into the “Public Domain” aside from natural
statutory expiration of copyright. The bottom-line is, there are few if
any objective, brightline rules for proactively placing
copyright-eligible works into the Public Domain that we can broadly
rely on.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-16 14:18:35 +08:00

37 lines
1.2 KiB
C

/****************************************************************************
* include/crypto/md5.h
*
* SPDX-License-Identifier: NuttX-PublicDomain
*
* 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.
* This code is in the public domain; do with it what you wish.
*
****************************************************************************/
#ifndef __INCLUDE_CRYPTO_MD5_H
#define __INCLUDE_CRYPTO_MD5_H
/****************************************************************************
* Included Files
****************************************************************************/
#include <sys/types.h>
#define MD5_BLOCK_LENGTH 64
#define MD5_DIGEST_LENGTH 16
typedef struct MD5CONTEXT
{
uint32_t state[4]; /* state */
uint64_t count; /* number of bits, mod 2^64 */
uint8_t buffer[MD5_BLOCK_LENGTH]; /* input buffer */
} MD5_CTX;
void md5init(FAR MD5_CTX *);
void md5update(FAR MD5_CTX *, FAR const void *, size_t);
void md5final(FAR uint8_t *, FAR MD5_CTX *);
void md5transform(FAR uint32_t *, FAR const uint8_t *);
#endif /* __INCLUDE_CRYPTO_MD5_H */