Merge pull request #10 from endgame/c-namespacing

C namespacing
This commit is contained in:
Kazu Yamamoto 2023-07-05 12:01:56 +09:00 committed by GitHub
commit 40c44347b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 5 deletions

View File

@ -1,3 +1,8 @@
## Unreleased (Minor)
* Add "crypton_" prefix to the final C symbols.
[#9](https://github.com/kazu-yamamoto/crypton/pull/9)
## 0.32
* All C symbols now have the "crypton_" prefix.

View File

@ -174,8 +174,8 @@ static __m128i gfmul_generic(__m128i tag, const table_4bit htable)
#ifdef WITH_PCLMUL
__m128i (*gfmul_branch_ptr)(__m128i a, const table_4bit t) = gfmul_generic;
#define gfmul(a,t) ((*gfmul_branch_ptr)(a,t))
__m128i (*crypton_gfmul_branch_ptr)(__m128i a, const table_4bit t) = gfmul_generic;
#define gfmul(a,t) ((*crypton_gfmul_branch_ptr)(a,t))
/* See Intel carry-less-multiplication-instruction-in-gcm-mode-paper.pdf
*
@ -257,7 +257,7 @@ void crypton_aesni_gf_mul_pclmul(block128 *a, const table_4bit htable)
void crypton_aesni_init_pclmul(void)
{
gfmul_branch_ptr = gfmul_pclmuldq;
crypton_gfmul_branch_ptr = gfmul_pclmuldq;
}
#else

View File

@ -258,7 +258,7 @@ int _crypton_blake2s_final( blake2s_state *S, void *out, size_t outlen )
}
/* inlen, at least, should be uint64_t. Others can be size_t. */
int blake2s( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen )
int crypton_blake2s( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen )
{
blake2s_state S[1];
@ -290,7 +290,7 @@ int blake2s( void *out, size_t outlen, const void *in, size_t inlen, const void
#if defined(SUPERCOP)
int crypto_hash( unsigned char *out, unsigned char *in, unsigned long long inlen )
{
return blake2s( out, BLAKE2S_OUTBYTES, in, inlen, NULL, 0 );
return crypton_blake2s( out, BLAKE2S_OUTBYTES, in, inlen, NULL, 0 );
}
#endif