mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2025-12-23 15:55:10 +01:00
Adapt the _ALT style to our new standard
- in .h files: only put the context declaration inside the #ifdef _ALT (this was changed in 2.9.0, ie after the original PR) - in .c file: only leave selftest out of _ALT: even though some function are trivial to build from other parts, alt implementors might want to go another way about them (for efficiency or other reasons)
This commit is contained in:
parent
ce8314f5f0
commit
95d0bdbd84
6 changed files with 27 additions and 27 deletions
|
|
@ -291,8 +291,6 @@ int mbedtls_aead_chacha20_poly1305_finish( mbedtls_aead_chacha20_poly1305_contex
|
|||
return( 0 );
|
||||
}
|
||||
|
||||
#endif /* MBEDTLS_AEAD_CHACHA20_POLY1305_ALT */
|
||||
|
||||
int mbedtls_aead_chacha20_poly1305_crypt_and_mac ( const unsigned char key[32],
|
||||
const unsigned char nonce[12],
|
||||
mbedtls_aead_chacha20_poly1305_mode_t mode,
|
||||
|
|
@ -331,6 +329,8 @@ cleanup:
|
|||
return( result );
|
||||
}
|
||||
|
||||
#endif /* MBEDTLS_AEAD_CHACHA20_POLY1305_ALT */
|
||||
|
||||
#if defined(MBEDTLS_SELF_TEST)
|
||||
|
||||
static const unsigned char test_key[1][32] =
|
||||
|
|
|
|||
|
|
@ -354,8 +354,6 @@ int mbedtls_chacha20_update( mbedtls_chacha20_context *ctx,
|
|||
return( 0 );
|
||||
}
|
||||
|
||||
#endif /* !MBEDTLS_CHACHA20_ALT */
|
||||
|
||||
int mbedtls_chacha20_crypt( const unsigned char key[32],
|
||||
const unsigned char nonce[12],
|
||||
uint32_t counter,
|
||||
|
|
@ -383,6 +381,8 @@ cleanup:
|
|||
return( result );
|
||||
}
|
||||
|
||||
#endif /* !MBEDTLS_CHACHA20_ALT */
|
||||
|
||||
#if defined(MBEDTLS_SELF_TEST)
|
||||
|
||||
static const unsigned char test_keys[2][32] =
|
||||
|
|
|
|||
|
|
@ -390,8 +390,6 @@ int mbedtls_poly1305_finish( mbedtls_poly1305_context *ctx,
|
|||
return( 0 );
|
||||
}
|
||||
|
||||
#endif /* MBEDTLS_POLY1305_ALT */
|
||||
|
||||
int mbedtls_poly1305_mac( const unsigned char key[32],
|
||||
size_t ilen,
|
||||
const unsigned char *input,
|
||||
|
|
@ -417,6 +415,8 @@ cleanup:
|
|||
return( 0 );
|
||||
}
|
||||
|
||||
#endif /* MBEDTLS_POLY1305_ALT */
|
||||
|
||||
#if defined(MBEDTLS_SELF_TEST)
|
||||
|
||||
static const unsigned char test_keys[2][32] =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue