Skip to content

Commit

Permalink
inline a couple of functions
Browse files Browse the repository at this point in the history
  • Loading branch information
shikokuchuo committed Mar 18, 2024
1 parent 010adbb commit 9196b02
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/secret2.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,19 @@
* http://csrc.nist.gov/publications/fips/fips180-2/fips180-2.pdf
*/

static uint32_t mbedtls_get_unaligned_uint32(const void *p) {
#if defined(__GNUC__)
__attribute__((always_inline))
#endif
static inline uint32_t mbedtls_get_unaligned_uint32(const void *p) {
uint32_t r;
memcpy(&r, p, sizeof(r));
return r;
}

static void mbedtls_put_unaligned_uint32(void *p, uint32_t x) {
#if defined(__GNUC__)
__attribute__((always_inline))
#endif
static inline void mbedtls_put_unaligned_uint32(void *p, uint32_t x) {
memcpy(p, &x, sizeof(x));
}

Expand Down

0 comments on commit 9196b02

Please sign in to comment.