@@ -21,7 +21,7 @@ namespace hmac_cpp {
2121 // / \param b Pointer to second array
2222 // / \param b_len Length of the second array
2323 // / \return true if both arrays are equal
24- bool constant_time_equals (const uint8_t * a, size_t a_len,
24+ HMAC_CPP_API bool constant_time_equals (const uint8_t * a, size_t a_len,
2525 const uint8_t * b, size_t b_len);
2626
2727 inline bool constant_time_equals (const std::vector<uint8_t >& a,
@@ -77,7 +77,7 @@ namespace hmac_cpp {
7777 // / \param dk_len Desired length of the derived key in bytes, must be positive
7878 // / \param hash_type Hash function to use (SHA1, SHA256, SHA512)
7979 // / \return Derived key as a vector of bytes
80- std::vector<uint8_t > pbkdf2 (
80+ HMAC_CPP_API std::vector<uint8_t > pbkdf2 (
8181 const void * password_ptr, size_t password_len,
8282 const void * salt_ptr, size_t salt_len,
8383 uint32_t iterations, size_t dk_len,
@@ -163,7 +163,7 @@ namespace hmac_cpp {
163163 // / \param out_ptr Output buffer for derived key
164164 // / \param dk_len Length of output buffer in bytes, must be positive
165165 // / \return true on success, false on invalid parameters
166- bool pbkdf2 (Pbkdf2Hash prf,
166+ HMAC_CPP_API bool pbkdf2 (Pbkdf2Hash prf,
167167 const void * password_ptr, size_t password_len,
168168 const void * salt_ptr, size_t salt_len,
169169 uint32_t iterations, uint8_t * out_ptr, size_t dk_len) noexcept ;
@@ -211,7 +211,7 @@ namespace hmac_cpp {
211211 // / \param out_ptr Output buffer for derived key
212212 // / \param dk_len Length of output buffer in bytes, must be positive
213213 // / \return true on success, false on invalid parameters
214- bool pbkdf2_hmac_sha256 (const void * password_ptr, size_t password_len,
214+ HMAC_CPP_API bool pbkdf2_hmac_sha256 (const void * password_ptr, size_t password_len,
215215 const void * salt_ptr, size_t salt_len,
216216 uint32_t iterations, uint8_t * out_ptr, size_t dk_len) noexcept ;
217217
@@ -271,7 +271,7 @@ namespace hmac_cpp {
271271 // / \param dk_len Desired length of the derived key in bytes, must be positive.
272272 // / \param prf Hash function to use (SHA1, SHA256, SHA512).
273273 // / \return Derived key as a vector of bytes.
274- std::vector<uint8_t > pbkdf2_with_pepper (
274+ HMAC_CPP_API std::vector<uint8_t > pbkdf2_with_pepper (
275275 const void * password_ptr, size_t password_len,
276276 const void * salt_ptr, size_t salt_len,
277277 const void * pepper_ptr, size_t pepper_len,
@@ -343,7 +343,7 @@ namespace hmac_cpp {
343343 // / \param salt_ptr Pointer to optional salt buffer (may be null when salt_len is 0).
344344 // / \param salt_len Length of the salt in bytes.
345345 // / \return Pseudorandom key (PRK) as a byte vector.
346- std::vector<uint8_t > hkdf_extract_sha256 (
346+ HMAC_CPP_API std::vector<uint8_t > hkdf_extract_sha256 (
347347 const void * ikm_ptr, size_t ikm_len,
348348 const void * salt_ptr, size_t salt_len);
349349
@@ -360,7 +360,7 @@ namespace hmac_cpp {
360360 // / \param info_len Length of the info buffer in bytes.
361361 // / \param L Length of output keying material in bytes.
362362 // / \return Output keying material as a byte vector.
363- std::vector<uint8_t > hkdf_expand_sha256 (
363+ HMAC_CPP_API std::vector<uint8_t > hkdf_expand_sha256 (
364364 const void * prk_ptr, size_t prk_len,
365365 const void * info_ptr, size_t info_len,
366366 size_t L);
@@ -401,7 +401,7 @@ namespace hmac_cpp {
401401 // / \param hash_type Hash function to use (SHA1, SHA256, SHA512). Default is SHA256
402402 // / \return Hex-encoded HMAC-SHA256 of the rounded time value
403403 // / \throws std::runtime_error if the system time cannot be retrieved
404- std::string generate_time_token (const std::vector<uint8_t >& key, int interval_sec = 60 , TypeHash hash_type = TypeHash::SHA256 );
404+ HMAC_CPP_API std::string generate_time_token (const std::vector<uint8_t >& key, int interval_sec = 60 , TypeHash hash_type = TypeHash::SHA256 );
405405 inline std::string generate_time_token (const secure_buffer<uint8_t >& key, int interval_sec = 60 , TypeHash hash_type = TypeHash::SHA256 ) {
406406 return generate_time_token (std::vector<uint8_t >(key.begin (), key.end ()), interval_sec, hash_type);
407407 }
@@ -418,7 +418,7 @@ namespace hmac_cpp {
418418 // / \param hash_type Hash function to use (SHA1, SHA256, SHA512). Default is SHA256
419419 // / \return true if the token is valid within the ±1 interval range; false otherwise
420420 // / \throws std::runtime_error if the system time cannot be retrieved
421- bool is_token_valid (const std::string &token, const std::vector<uint8_t >& key, int interval_sec = 60 , TypeHash hash_type = TypeHash::SHA256 );
421+ HMAC_CPP_API bool is_token_valid (const std::string &token, const std::vector<uint8_t >& key, int interval_sec = 60 , TypeHash hash_type = TypeHash::SHA256 );
422422 inline bool is_token_valid (const std::string &token, const secure_buffer<uint8_t >& key, int interval_sec = 60 , TypeHash hash_type = TypeHash::SHA256 ) {
423423 return is_token_valid (token, std::vector<uint8_t >(key.begin (), key.end ()), interval_sec, hash_type);
424424 }
@@ -435,7 +435,7 @@ namespace hmac_cpp {
435435 // / \param hash_type Hash function to use (SHA1, SHA256, SHA512). Default is SHA256
436436 // / \return Hex-encoded HMAC-SHA256 of the concatenated timestamp and fingerprint
437437 // / \throws std::runtime_error if the system time cannot be retrieved
438- std::string generate_time_token (const std::vector<uint8_t >& key, const std::string &fingerprint, int interval_sec = 60 , TypeHash hash_type = TypeHash::SHA256 );
438+ HMAC_CPP_API std::string generate_time_token (const std::vector<uint8_t >& key, const std::string &fingerprint, int interval_sec = 60 , TypeHash hash_type = TypeHash::SHA256 );
439439 inline std::string generate_time_token (const secure_buffer<uint8_t >& key, const std::string &fingerprint, int interval_sec = 60 , TypeHash hash_type = TypeHash::SHA256 ) {
440440 return generate_time_token (std::vector<uint8_t >(key.begin (), key.end ()), fingerprint, interval_sec, hash_type);
441441 }
@@ -453,7 +453,7 @@ namespace hmac_cpp {
453453 // / \param hash_type Hash function to use (SHA1, SHA256, SHA512). Default is SHA256
454454 // / \return true if the token is valid within the ±1 interval range; false otherwise
455455 // / \throws std::runtime_error if the system time cannot be retrieved
456- bool is_token_valid (const std::string &token, const std::vector<uint8_t >& key, const std::string &fingerprint, int interval_sec = 60 , TypeHash hash_type = TypeHash::SHA256 );
456+ HMAC_CPP_API bool is_token_valid (const std::string &token, const std::vector<uint8_t >& key, const std::string &fingerprint, int interval_sec = 60 , TypeHash hash_type = TypeHash::SHA256 );
457457 inline bool is_token_valid (const std::string &token, const secure_buffer<uint8_t >& key, const std::string &fingerprint, int interval_sec = 60 , TypeHash hash_type = TypeHash::SHA256 ) {
458458 return is_token_valid (token, std::vector<uint8_t >(key.begin (), key.end ()), fingerprint, interval_sec, hash_type);
459459 }
@@ -470,7 +470,7 @@ namespace hmac_cpp {
470470 // / \param digits Desired number of digits in the OTP (typically 6–8, max 9)
471471 // / \param hash_type Hash function to use (SHA1, SHA256, SHA512). Default is SHA1
472472 // / \return One-Time Password (OTP) as an integer in the range [0, 10^digits)
473- int get_hotp_code (const void * key_ptr, size_t key_len, uint64_t counter, int digits = 6 , TypeHash hash_type = TypeHash::SHA1 );
473+ HMAC_CPP_API int get_hotp_code (const void * key_ptr, size_t key_len, uint64_t counter, int digits = 6 , TypeHash hash_type = TypeHash::SHA1 );
474474
475475 // / \brief Computes HOTP code from a vector of bytes as key (RFC 4226)
476476 // / \tparam T Must be either `char` or `uint8_t`
@@ -508,7 +508,7 @@ namespace hmac_cpp {
508508 // / \param digits Desired number of digits in the OTP (1-9)
509509 // / \return One-Time Password (OTP) as an integer
510510 // / \throws std::runtime_error if the digest is too short for dynamic truncation
511- int hotp_from_digest (const std::vector<uint8_t >& hmac_result, int digits);
511+ HMAC_CPP_API int hotp_from_digest (const std::vector<uint8_t >& hmac_result, int digits);
512512 }
513513
514514 // / \brief Computes TOTP (Time-Based One-Time Password) code for a specific timestamp
@@ -521,7 +521,7 @@ namespace hmac_cpp {
521521 // / \param hash_type Hash function to use (SHA1, SHA256, SHA512; default: SHA1)
522522 // / \return TOTP code as an integer
523523 // / \throws std::invalid_argument if period <= 0 or digits not in [1,9]
524- int get_totp_code_at (
524+ HMAC_CPP_API int get_totp_code_at (
525525 const void * key_ptr,
526526 size_t key_len,
527527 uint64_t timestamp,
@@ -587,7 +587,7 @@ namespace hmac_cpp {
587587 // / \return TOTP code as an integer.
588588 // / \throws std::invalid_argument if period <= 0 or digits not in [1,9].
589589 // / \throws std::runtime_error if the system time cannot be retrieved.
590- int get_totp_code (
590+ HMAC_CPP_API int get_totp_code (
591591 const void * key_ptr,
592592 size_t key_len,
593593 int period = 30 ,
@@ -638,7 +638,7 @@ namespace hmac_cpp {
638638 // / The +1 step check is skipped when the computed counter equals
639639 // / std::numeric_limits<uint64_t>::max().
640640 // / \throws std::invalid_argument if period <= 0 or digits not in [1,9]
641- bool is_totp_token_valid (
641+ HMAC_CPP_API bool is_totp_token_valid (
642642 int token,
643643 const void * key_ptr,
644644 size_t key_len,
@@ -728,7 +728,7 @@ namespace hmac_cpp {
728728 // / std::numeric_limits<uint64_t>::max().
729729 // / \throws std::invalid_argument if period <= 0 or digits not in [1,9]
730730 // / \throws std::runtime_error if the system time cannot be retrieved
731- bool is_totp_token_valid (
731+ HMAC_CPP_API bool is_totp_token_valid (
732732 int token,
733733 const void * key_ptr,
734734 size_t key_len,
0 commit comments