Skip to content

Commit b3281e5

Browse files
committed
[4.2.0] Update changelog, prepare release
1 parent 581b442 commit b3281e5

File tree

6 files changed

+13
-11
lines changed

6 files changed

+13
-11
lines changed

Changelog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## [Unreleased]
44

5+
## [4.2.0] - 2024-06-19
6+
57
- Implement commodore fujinet-lib functions
68
- Add fuji_open_directory2 prototype for applications to send path and
79
filter separately rather than in fixed 256 byte buffer with \0 delimiter. Used by CBM.

common/src/fn_fuji/fuji_hash_calculate.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
#include "fujinet-fuji.h"
1414

15-
bool fuji_hash_calculate(_hash_type hash_type, bool as_hex, bool discard_data, uint8_t *output)
15+
bool fuji_hash_calculate(hash_alg_t hash_type, bool as_hex, bool discard_data, uint8_t *output)
1616
{
1717
uint8_t hash_len;
1818
bool is_success;

common/src/fn_fuji/fuji_hash_data.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
#include "fujinet-fuji.h"
1414

15-
bool fuji_hash_data(_hash_type hash_type, uint8_t *input, uint16_t length, bool as_hex, uint8_t *output)
15+
bool fuji_hash_data(hash_alg_t hash_type, uint8_t *input, uint16_t length, bool as_hex, uint8_t *output)
1616
{
1717
uint8_t hash_len;
1818
bool is_success;

common/src/fn_fuji/fuji_hash_size.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#include <stdint.h>
33
#include "fujinet-fuji.h"
44

5-
uint16_t fuji_hash_size(_hash_type hash_type, bool is_hex)
5+
uint16_t fuji_hash_size(hash_alg_t hash_type, bool is_hex)
66
{
77
uint16_t len = 0; // acts as default if hashing algorithm is unknown. Allow for a full word in case we extend to longer hash algorithms
88
switch(hash_type)

fujinet-fuji.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -547,27 +547,27 @@ enum HashType
547547
SHA512
548548
};
549549

550-
typedef enum HashType _hash_type;
550+
typedef enum HashType hash_alg_t;
551551

552552
/**
553553
* @brief Returns the size of the hash that will be produced for the given hash_type and whether hex output is required or not. This should be used to calculate the memory needed for the output of \ref fuji_hash_data
554-
* @param hash_type The \ref _hash_type "type of hash" to use: MD5, SHA1, SHA256, SHA512
554+
* @param hash_type The \ref hash_alg_t "type of hash" to use: MD5, SHA1, SHA256, SHA512
555555
* @param as_hex True if the returned data should be a hex string, false if it should be binary. Hex has twice the length as binary in the output.
556556
* @return the length of the hash that will be computed for this algorithm depending on whether hex is being returned or not.
557557
*/
558-
uint16_t fuji_hash_size(_hash_type hash_type, bool as_hex);
558+
uint16_t fuji_hash_size(hash_alg_t hash_type, bool as_hex);
559559

560560
/**
561561
* @brief Computes the hash of the given input data in a single operation. This is a simpler interface than using \ref fuji_hash_clear, \ref fuji_hash_add, \ref fuji_hash_calculate, and can be used instead of those 3 operations if there is only 1 piece of data to hash.
562562
* This will also clear any data previously add using fuji_hash_add, and also clears any memory associated with hashing in the FujiNet at the end of the operation. It is the one stop shop, if you use it with the other 3 functions, you must sequence them correctly so this function doesn't clear the existing sent data.
563-
* @param hash_type The \ref _hash_type "type of hash" to use: MD5, SHA1, SHA256, SHA512
563+
* @param hash_type The \ref hash_alg_t "type of hash" to use: MD5, SHA1, SHA256, SHA512
564564
* @param input The binary data that requires hash computed on
565565
* @param length The length of binary data in "input" to compute a hash on
566566
* @param as_hex True if the returned data should be a hex string, false if it should be binary. Hex has twice the length as binary in the output.
567567
* @param output The buffer to write the hash value to. This must be allocated by the application itself, it is not done in the library. \ref fuji_hash_value "fuji_hash_value()".
568568
* @returns sucess status of the operation
569569
*/
570-
bool fuji_hash_data(_hash_type hash_type, uint8_t *input, uint16_t length, bool as_hex, uint8_t *output);
570+
bool fuji_hash_data(hash_alg_t hash_type, uint8_t *input, uint16_t length, bool as_hex, uint8_t *output);
571571

572572
/**
573573
* @brief Clear any data associated with hashing in the Fujinet. Should be called before calculating new hashes when using \ref fuji_hash_add and \ref fuji_hash_calculate. Can also be called to discard any data previously sent to free memory on the FujiNet used for any previous data sent with \ref fuji_hash_add.
@@ -585,12 +585,12 @@ bool fuji_hash_add(uint8_t *data, uint16_t length);
585585

586586
/**
587587
* @brief Calculates the hash of the accumulated data. Can be called multiple times with different hash_type values on the same data if discard_data is false. If different data is required to be hashed, call \ref fuji_hash_clear to start over, then add data with \ref fuji_hash_add again.
588-
* @param hash_type The \ref _hash_type "type of hash" to use: MD5, SHA1, SHA256, SHA512
588+
* @param hash_type The \ref hash_alg_t "type of hash" to use: MD5, SHA1, SHA256, SHA512
589589
* @param as_hex True if the returned data should be a hex string, false if it should be binary. Hex has twice the length as binary in the output.
590590
* @param discard_data If true the data will be freed from FujiNet memory after the hash is calculated. Use false if you are calculating more than one hash type on the data, and end with discard_data is true, or call \ref fuji_hash_clear to also clean up.
591591
* @param output The buffer to write the hash to. The caller is responsible for allocating enough memory for this (based on \ref fuji_hash_length)
592592
* @return the success status of the operation.
593593
*/
594-
bool fuji_hash_calculate(_hash_type hash_type, bool as_hex, bool discard_data, uint8_t *output);
594+
bool fuji_hash_calculate(hash_alg_t hash_type, bool as_hex, bool discard_data, uint8_t *output);
595595

596596
#endif /* FN_FUJI_H */

version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.1.5
1+
4.2.0

0 commit comments

Comments
 (0)