Consistently use cryptogams_ prefix for Andy Polyakov's code (PR #952)

This commit is contained in:
Jeffrey Walton 2020-12-26 03:16:42 -05:00
parent 8eeaab2316
commit 0e117ee65b
No known key found for this signature in database
GPG Key ID: B36AB348921B1838
10 changed files with 115 additions and 115 deletions

View File

@ -183,14 +183,14 @@ AES_Te:
.word 0x1B000000, 0x36000000, 0, 0, 0, 0, 0, 0
.size AES_Te,.-AES_Te
@ void AES_encrypt_block(const unsigned char *in, unsigned char *out,
@ void cryptogams_AES_encrypt_block(const unsigned char *in, unsigned char *out,
@ const AES_KEY *key) {
.globl AES_encrypt_block
.type AES_encrypt_block,%function
.globl cryptogams_AES_encrypt_block
.type cryptogams_AES_encrypt_block,%function
.align 5
AES_encrypt_block:
cryptogams_AES_encrypt_block:
#ifndef __thumb2__
sub r3,pc,#8 @ AES_encrypt_block
sub r3,pc,#8 @ cryptogams_AES_encrypt_block
#else
adr r3,.
#endif
@ -198,7 +198,7 @@ AES_encrypt_block:
#if defined(__thumb2__) || defined(__APPLE__)
adr r10,AES_Te
#else
sub r10,r3,#AES_encrypt_block-AES_Te @ Te
sub r10,r3,#cryptogams_AES_encrypt_block-AES_Te @ Te
#endif
mov r12,r0 @ inp
mov r11,r2
@ -243,7 +243,7 @@ AES_encrypt_block:
rev r3,r3
#endif
#endif
bl _armv4_AES_encrypt_block
bl _cryptogams_armv4_AES_encrypt_block
ldr r12,[sp],#4 @ pop out
#if __ARM_ARCH__>=7
@ -295,11 +295,11 @@ AES_encrypt_block:
moveq pc,lr @ be binary compatible with V4, yet
.word 0xe12fff1e @ interoperable with Thumb ISA:-)
#endif
.size AES_encrypt_block,.-AES_encrypt_block
.size cryptogams_AES_encrypt_block,.-cryptogams_AES_encrypt_block
.type _armv4_AES_encrypt_block,%function
.type _cryptogams_armv4_AES_encrypt_block,%function
.align 2
_armv4_AES_encrypt_block:
_cryptogams_armv4_AES_encrypt_block:
str lr,[sp,#-4]! @ push lr
ldmia r11!,{r4,r5,r6,r7}
eor r0,r0,r4
@ -432,12 +432,12 @@ _armv4_AES_encrypt_block:
sub r10,r10,#2
ldr pc,[sp],#4 @ pop and return
.size _armv4_AES_encrypt_block,.-_armv4_AES_encrypt_block
.size _cryptogams_armv4_AES_encrypt_block,.-_cryptogams_armv4_AES_encrypt_block
.globl AES_set_encrypt_key_ARM
.type AES_set_encrypt_key_ARM,%function
.globl cryptogams_AES_set_encrypt_key
.type cryptogams_AES_set_encrypt_key,%function
.align 5
AES_set_encrypt_key_ARM:
cryptogams_AES_set_encrypt_key:
_armv4_AES_set_encrypt_key:
#ifndef __thumb2__
sub r3,pc,#8 @ AES_set_encrypt_key
@ -738,12 +738,12 @@ _armv4_AES_set_encrypt_key:
moveq pc,lr @ be binary compatible with V4, yet
.word 0xe12fff1e @ interoperable with Thumb ISA:-)
#endif
.size AES_set_encrypt_key_ARM,.-AES_set_encrypt_key_ARM
.size cryptogams_AES_set_encrypt_key,.-cryptogams_AES_set_encrypt_key
.globl AES_set_decrypt_key_ARM
.type AES_set_decrypt_key_ARM,%function
.globl cryptogams_AES_set_decrypt_key
.type cryptogams_AES_set_decrypt_key,%function
.align 5
AES_set_decrypt_key_ARM:
cryptogams_AES_set_decrypt_key:
str lr,[sp,#-4]! @ push lr
bl _armv4_AES_set_encrypt_key
teq r0,#0
@ -753,13 +753,13 @@ AES_set_decrypt_key_ARM:
mov r0,r2 @ AES_set_encrypt_key preserves r2,
mov r1,r2 @ which is AES_KEY *key
b _armv4_AES_set_enc2dec_key
.size AES_set_decrypt_key_ARM,.-AES_set_decrypt_key_ARM
.size cryptogams_AES_set_decrypt_key,.-cryptogams_AES_set_decrypt_key
@ void AES_set_enc2dec_key_ARM(const AES_KEY *inp,AES_KEY *out)
.globl AES_set_enc2dec_key_ARM
.type AES_set_enc2dec_key_ARM,%function
@ void cryptogams_AES_set_enc2dec_key_ARM(const AES_KEY *inp,AES_KEY *out)
.globl cryptogams_AES_set_enc2dec_key_ARM
.type cryptogams_AES_set_enc2dec_key_ARM,%function
.align 5
AES_set_enc2dec_key_ARM:
cryptogams_AES_set_enc2dec_key_ARM:
_armv4_AES_set_enc2dec_key:
stmdb sp!,{r4,r5,r6,r7,r8,r9,r10,r11,r12,lr}
@ -850,7 +850,7 @@ _armv4_AES_set_enc2dec_key:
moveq pc,lr @ be binary compatible with V4, yet
.word 0xe12fff1e @ interoperable with Thumb ISA:-)
#endif
.size AES_set_enc2dec_key_ARM,.-AES_set_enc2dec_key_ARM
.size cryptogams_AES_set_enc2dec_key_ARM,.-cryptogams_AES_set_enc2dec_key_ARM
.type AES_Td,%object
.align 5
@ -954,14 +954,14 @@ AES_Td:
.byte 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d
.size AES_Td,.-AES_Td
@ void AES_decrypt_block(const unsigned char *in, unsigned char *out,
@ void cryptogams_AES_decrypt_block(const unsigned char *in, unsigned char *out,
@ const AES_KEY *key) {
.globl AES_decrypt_block
.type AES_decrypt_block,%function
.globl cryptogams_AES_decrypt_block
.type cryptogams_AES_decrypt_block,%function
.align 5
AES_decrypt_block:
cryptogams_AES_decrypt_block:
#ifndef __thumb2__
sub r3,pc,#8 @ AES_decrypt_block
sub r3,pc,#8 @ cryptogams_AES_decrypt_block
#else
adr r3,.
#endif
@ -969,7 +969,7 @@ AES_decrypt_block:
#if defined(__thumb2__) || defined(__APPLE__)
adr r10,AES_Td
#else
sub r10,r3,#AES_decrypt_block-AES_Td @ Td
sub r10,r3,#cryptogams_AES_decrypt_block-AES_Td @ Td
#endif
mov r12,r0 @ inp
mov r11,r2
@ -1014,7 +1014,7 @@ AES_decrypt_block:
rev r3,r3
#endif
#endif
bl _armv4_AES_decrypt_block
bl _cryptogams_armv4_AES_decrypt_block
ldr r12,[sp],#4 @ pop out
#if __ARM_ARCH__>=7
@ -1066,11 +1066,11 @@ AES_decrypt_block:
moveq pc,lr @ be binary compatible with V4, yet
.word 0xe12fff1e @ interoperable with Thumb ISA:-)
#endif
.size AES_decrypt_block,.-AES_decrypt_block
.size cryptogams_AES_decrypt_block,.-cryptogams_AES_decrypt_block
.type _armv4_AES_decrypt_block,%function
.type _cryptogams_armv4_AES_decrypt_block,%function
.align 2
_armv4_AES_decrypt_block:
_cryptogams_armv4_AES_decrypt_block:
str lr,[sp,#-4]! @ push lr
ldmia r11!,{r4,r5,r6,r7}
eor r0,r0,r4
@ -1212,4 +1212,4 @@ _armv4_AES_decrypt_block:
sub r10,r10,#1024
ldr pc,[sp],#4 @ pop and return
.size _armv4_AES_decrypt_block,.-_armv4_AES_decrypt_block
.size _cryptogams_armv4_AES_decrypt_block,.-_cryptogams_armv4_AES_decrypt_block

View File

@ -18,10 +18,10 @@ extern "C" {
// Instead of AES_KEY we use a 'word32 rkey[4*15+4]'. It has space for
// both the AES_MAXNR round keys and the number of rounds in the tail.
int AES_set_encrypt_key_ARM(const unsigned char *userKey, const int bits, unsigned int *rkey);
int AES_set_decrypt_key_ARM(const unsigned char *userKey, const int bits, unsigned int *rkey);
void AES_encrypt_block(const unsigned char *in, unsigned char *out, const unsigned int *rkey);
void AES_decrypt_block(const unsigned char *in, unsigned char *out, const unsigned int *rkey);
int cryptogams_AES_set_encrypt_key(const unsigned char *userKey, const int bits, unsigned int *rkey);
int cryptogams_AES_set_decrypt_key(const unsigned char *userKey, const int bits, unsigned int *rkey);
void cryptogams_AES_encrypt_block(const unsigned char *in, unsigned char *out, const unsigned int *rkey);
void cryptogams_AES_decrypt_block(const unsigned char *in, unsigned char *out, const unsigned int *rkey);
#ifdef __cplusplus
}

View File

@ -330,10 +330,10 @@ extern size_t Rijndael_Dec_AdvancedProcessBlocks_ARMV8(const word32 *subkeys, si
#endif
#if (CRYPTOGAMS_ARM_AES)
extern "C" int AES_set_encrypt_key_ARM(const unsigned char *userKey, const int bitLen, word32 *rkey);
extern "C" int AES_set_decrypt_key_ARM(const unsigned char *userKey, const int bitLen, word32 *rkey);
extern "C" void AES_encrypt_block(const unsigned char *in, unsigned char *out, const word32 *rkey);
extern "C" void AES_decrypt_block(const unsigned char *in, unsigned char *out, const word32 *rkey);
extern "C" int cryptogams_AES_set_encrypt_key(const unsigned char *userKey, const int bitLen, word32 *rkey);
extern "C" int cryptogams_AES_set_decrypt_key(const unsigned char *userKey, const int bitLen, word32 *rkey);
extern "C" void cryptogams_AES_encrypt_block(const unsigned char *in, unsigned char *out, const word32 *rkey);
extern "C" void cryptogams_AES_decrypt_block(const unsigned char *in, unsigned char *out, const word32 *rkey);
#endif
#if (CRYPTOPP_POWER8_AES_AVAILABLE)
@ -349,21 +349,21 @@ extern size_t Rijndael_Dec_AdvancedProcessBlocks128_6x1_ALTIVEC(const word32 *su
#if (CRYPTOGAMS_ARM_AES)
int CRYPTOGAMS_set_encrypt_key(const byte *userKey, const int bitLen, word32 *rkey)
{
return AES_set_encrypt_key_ARM(userKey, bitLen, rkey);
return cryptogams_AES_set_encrypt_key(userKey, bitLen, rkey);
}
int CRYPTOGAMS_set_decrypt_key(const byte *userKey, const int bitLen, word32 *rkey)
{
return AES_set_decrypt_key_ARM(userKey, bitLen, rkey);
return cryptogams_AES_set_decrypt_key(userKey, bitLen, rkey);
}
void CRYPTOGAMS_encrypt(const byte *inBlock, const byte *xorBlock, byte *outBlock, const word32 *rkey)
{
AES_encrypt_block(inBlock, outBlock, rkey);
cryptogams_AES_encrypt_block(inBlock, outBlock, rkey);
if (xorBlock)
xorbuf (outBlock, xorBlock, 16);
}
void CRYPTOGAMS_decrypt(const byte *inBlock, const byte *xorBlock, byte *outBlock, const word32 *rkey)
{
AES_decrypt_block(inBlock, outBlock, rkey);
cryptogams_AES_decrypt_block(inBlock, outBlock, rkey);
if (xorBlock)
xorbuf (outBlock, xorBlock, 16);
}

48
sha.cpp
View File

@ -67,8 +67,8 @@ extern void SHA256_HashMultipleBlocks_SHANI(word32 *state, const word32 *data, s
#endif
#if CRYPTOGAMS_ARM_SHA1
extern "C" void sha1_block_data_order_ARM(word32* state, const word32 *data, size_t blocks);
extern "C" void sha1_block_data_order_neon(word32* state, const word32 *data, size_t blocks);
extern "C" void cryptogams_sha1_block_data_order(word32* state, const word32 *data, size_t blocks);
extern "C" void cryptogams_sha1_block_data_order_neon(word32* state, const word32 *data, size_t blocks);
#endif
#if CRYPTOPP_ARM_SHA1_AVAILABLE
@ -80,8 +80,8 @@ extern void SHA256_HashMultipleBlocks_ARMV8(word32 *state, const word32 *data, s
#endif
#if CRYPTOGAMS_ARM_SHA256
extern "C" void sha256_block_data_order(word32* state, const word32 *data, size_t blocks);
extern "C" void sha256_block_data_order_neon(word32* state, const word32 *data, size_t blocks);
extern "C" void cryptogams_sha256_block_data_order(word32* state, const word32 *data, size_t blocks);
extern "C" void cryptogams_sha256_block_data_order_neon(word32* state, const word32 *data, size_t blocks);
#endif
#if CRYPTOPP_ARM_SHA512_AVAILABLE
@ -94,8 +94,8 @@ extern void SHA512_HashMultipleBlocks_POWER8(word64 *state, const word64 *data,
#endif
#if CRYPTOGAMS_ARM_SHA512
extern "C" void sha512_block_data_order(word64* state, const word64 *data, size_t blocks);
extern "C" void sha512_block_data_order_neon(word64* state, const word64 *data, size_t blocks);
extern "C" void cryptogams_sha512_block_data_order(word64* state, const word64 *data, size_t blocks);
extern "C" void cryptogams_sha512_block_data_order_neon(word64* state, const word64 *data, size_t blocks);
#endif
// We add extern to export table to sha_simd.cpp, but it
@ -297,9 +297,9 @@ void SHA1::Transform(word32 *state, const word32 *data)
# if defined(CRYPTOPP_LITTLE_ENDIAN)
word32 dataBuf[16];
ByteReverse(dataBuf, data, SHA1::BLOCKSIZE);
sha1_block_data_order_neon(state, data, 1);
cryptogams_sha1_block_data_order_neon(state, data, 1);
# else
sha1_block_data_order_neon(state, data, 1);
cryptogams_sha1_block_data_order_neon(state, data, 1);
# endif
return;
}
@ -308,9 +308,9 @@ void SHA1::Transform(word32 *state, const word32 *data)
# if defined(CRYPTOPP_LITTLE_ENDIAN)
word32 dataBuf[16];
ByteReverse(dataBuf, data, SHA1::BLOCKSIZE);
sha1_block_data_order_ARM(state, data, 1);
cryptogams_sha1_block_data_order(state, data, 1);
# else
sha1_block_data_order_ARM(state, data, 1);
cryptogams_sha1_block_data_order(state, data, 1);
# endif
return;
}
@ -341,12 +341,12 @@ size_t SHA1::HashMultipleBlocks(const word32 *input, size_t length)
#if CRYPTOGAMS_ARM_SHA1
if (HasNEON())
{
sha1_block_data_order_neon(m_state, input, length / SHA1::BLOCKSIZE);
cryptogams_sha1_block_data_order_neon(m_state, input, length / SHA1::BLOCKSIZE);
return length & (SHA1::BLOCKSIZE - 1);
}
if (HasARMv7())
{
sha1_block_data_order_ARM(m_state, input, length / SHA1::BLOCKSIZE);
cryptogams_sha1_block_data_order(m_state, input, length / SHA1::BLOCKSIZE);
return length & (SHA1::BLOCKSIZE - 1);
}
#endif
@ -858,9 +858,9 @@ void SHA256::Transform(word32 *state, const word32 *data)
# if defined(CRYPTOPP_LITTLE_ENDIAN)
word32 dataBuf[16];
ByteReverse(dataBuf, data, SHA256::BLOCKSIZE);
sha256_block_data_order_neon(state, data, 1);
cryptogams_sha256_block_data_order_neon(state, data, 1);
# else
sha256_block_data_order_neon(state, data, 1);
cryptogams_sha256_block_data_order_neon(state, data, 1);
# endif
return;
}
@ -869,9 +869,9 @@ void SHA256::Transform(word32 *state, const word32 *data)
# if defined(CRYPTOPP_LITTLE_ENDIAN)
word32 dataBuf[16];
ByteReverse(dataBuf, data, SHA256::BLOCKSIZE);
sha256_block_data_order(state, data, 1);
cryptogams_sha256_block_data_order(state, data, 1);
# else
sha256_block_data_order(state, data, 1);
cryptogams_sha256_block_data_order(state, data, 1);
# endif
return;
}
@ -917,12 +917,12 @@ size_t SHA256::HashMultipleBlocks(const word32 *input, size_t length)
#if CRYPTOGAMS_ARM_SHA256
if (HasNEON())
{
sha256_block_data_order_neon(m_state, input, length / SHA256::BLOCKSIZE);
cryptogams_sha256_block_data_order_neon(m_state, input, length / SHA256::BLOCKSIZE);
return length & (SHA256::BLOCKSIZE - 1);
}
if (HasARMv7())
{
sha256_block_data_order(m_state, input, length / SHA256::BLOCKSIZE);
cryptogams_sha256_block_data_order(m_state, input, length / SHA256::BLOCKSIZE);
return length & (SHA256::BLOCKSIZE - 1);
}
#endif
@ -985,12 +985,12 @@ size_t SHA224::HashMultipleBlocks(const word32 *input, size_t length)
#if CRYPTOGAMS_ARM_SHA256
if (HasNEON())
{
sha256_block_data_order_neon(m_state, input, length / SHA256::BLOCKSIZE);
cryptogams_sha256_block_data_order_neon(m_state, input, length / SHA256::BLOCKSIZE);
return length & (SHA256::BLOCKSIZE - 1);
}
if (HasARMv7())
{
sha256_block_data_order(m_state, input, length / SHA256::BLOCKSIZE);
cryptogams_sha256_block_data_order(m_state, input, length / SHA256::BLOCKSIZE);
return length & (SHA256::BLOCKSIZE - 1);
}
#endif
@ -1356,9 +1356,9 @@ void SHA512::Transform(word64 *state, const word64 *data)
# if (CRYPTOPP_LITTLE_ENDIAN)
word64 dataBuf[16];
ByteReverse(dataBuf, data, SHA512::BLOCKSIZE);
sha512_block_data_order_neon(state, dataBuf, 1);
cryptogams_sha512_block_data_order_neon(state, dataBuf, 1);
# else
sha512_block_data_order_neon(state, data, 1);
cryptogams_sha512_block_data_order_neon(state, data, 1);
# endif
return;
}
@ -1367,9 +1367,9 @@ void SHA512::Transform(word64 *state, const word64 *data)
# if (CRYPTOPP_LITTLE_ENDIAN)
word64 dataBuf[16];
ByteReverse(dataBuf, data, SHA512::BLOCKSIZE);
sha512_block_data_order(state, dataBuf, 1);
cryptogams_sha512_block_data_order(state, dataBuf, 1);
# else
sha512_block_data_order(state, data, 1);
cryptogams_sha512_block_data_order(state, data, 1);
# endif
return;
}

View File

@ -64,7 +64,7 @@
# endif
# endif
# define ARMV7_NEON (1<<0)
# define CRYPTOGAMS_ARMV7_NEON (1<<0)
@ JW, MAY 2019: End defines from taken from arm_arch.h
@ Back to original Cryptogams code
@ -79,16 +79,16 @@
.text
.align 5
.globl sha1_block_data_order_ARM
.type sha1_block_data_order_ARM,%function
.globl cryptogams_sha1_block_data_order
.type cryptogams_sha1_block_data_order,%function
sha1_block_data_order_ARM:
.Lsha1_block_data_order_ARM:
cryptogams_sha1_block_data_order:
.Lcryptogams_sha1_block_data_order:
#if __ARM_ARCH__<7 && !defined(__thumb2__)
sub r3,pc,#8 @ sha1_block_data_order_ARM
sub r3,pc,#8 @ cryptogams_sha1_block_data_order
#else
adr r3,.Lsha1_block_data_order_ARM
adr r3,.Lcryptogams_sha1_block_data_order
#endif
stmdb sp!,{r4,r5,r6,r7,r8,r9,r10,r11,r12,lr}
@ -542,7 +542,7 @@ sha1_block_data_order_ARM:
moveq pc,lr @ be binary compatible with V4, yet
.word 0xe12fff1e @ interoperable with Thumb ISA:-)
#endif
.size sha1_block_data_order_ARM,.-sha1_block_data_order_ARM
.size cryptogams_sha1_block_data_order,.-cryptogams_sha1_block_data_order
.align 5
.LK_00_19:.word 0x5a827999
@ -555,11 +555,11 @@ sha1_block_data_order_ARM:
.arch armv7-a
.fpu neon
.globl sha1_block_data_order_neon
.type sha1_block_data_order_neon,%function
.globl cryptogams_sha1_block_data_order_neon
.type cryptogams_sha1_block_data_order_neon,%function
.align 4
sha1_block_data_order_neon:
cryptogams_sha1_block_data_order_neon:
stmdb sp!,{r4,r5,r6,r7,r8,r9,r10,r11,r12,lr}
add r2,r1,r2,lsl#6 @ r2 to point at the end of r1
@ -1406,5 +1406,5 @@ sha1_block_data_order_neon:
@ vldmia sp!,{d8-d15}
ldmia sp!,{r4,r5,r6,r7,r8,r9,r10,r11,r12,pc}
.size sha1_block_data_order_neon,.-sha1_block_data_order_neon
.size cryptogams_sha1_block_data_order_neon,.-cryptogams_sha1_block_data_order_neon
#endif

View File

@ -11,10 +11,10 @@ extern "C" {
/* Crypto++ modifed sha1_block_data_order to pass caps as a parameter. */
/* Also see https://github.com/weidai11/cryptopp/issues/846. */
void sha1_block_data_order_ARM(void *state, const void *data, size_t blocks);
void cryptogams_sha1_block_data_order(void *state, const void *data, size_t blocks);
/* Cryptogams arm caps */
#define ARMV7_NEON (1<<0)
#define CRYPTOGAMS_ARMV7_NEON (1<<0)
#ifdef __cplusplus
}

View File

@ -64,7 +64,7 @@
# endif
# endif
# define ARMV7_NEON (1<<0)
# define CRYPTOGAMS_ARMV7_NEON (1<<0)
@ JW, MAY 2019: End defines from taken from arm_arch.h
@ Back to original Cryptogams code
@ -101,16 +101,16 @@ K256:
.word 0 @ terminator
.align 5
.globl sha256_block_data_order
.type sha256_block_data_order,%function
.globl cryptogams_sha256_block_data_order
.type cryptogams_sha256_block_data_order,%function
sha256_block_data_order:
.Lsha256_block_data_order:
cryptogams_sha256_block_data_order:
.Lcryptogams_sha256_block_data_order:
#if __ARM_ARCH__<7 && !defined(__thumb2__)
sub r3,pc,#8 @ sha256_block_data_order
sub r3,pc,#8 @ cryptogams_sha256_block_data_order
#else
adr r3,.Lsha256_block_data_order
adr r3,.Lcryptogams_sha256_block_data_order
#endif
add r2,r1,r2,lsl#6 @ len to point at the end of inp
@ -1879,17 +1879,17 @@ sha256_block_data_order:
moveq pc,lr @ be binary compatible with V4, yet
.word 0xe12fff1e @ interoperable with Thumb ISA:-)
#endif
.size sha256_block_data_order,.-sha256_block_data_order
.size cryptogams_sha256_block_data_order,.-cryptogams_sha256_block_data_order
#if __ARM_MAX_ARCH__>=7
.arch armv7-a
.fpu neon
.globl sha256_block_data_order_neon
.type sha256_block_data_order_neon,%function
.globl cryptogams_sha256_block_data_order_neon
.type cryptogams_sha256_block_data_order_neon,%function
.align 5
.skip 16
sha256_block_data_order_neon:
cryptogams_sha256_block_data_order_neon:
stmdb sp!,{r4,r5,r6,r7,r8,r9,r10,r11,r12,lr}
@ -2666,5 +2666,5 @@ sha256_block_data_order_neon:
bne .L_00_48
ldmia sp!,{r4,r5,r6,r7,r8,r9,r10,r11,r12,pc}
.size sha256_block_data_order_neon,.-sha256_block_data_order_neon
.size cryptogams_sha256_block_data_order_neon,.-cryptogams_sha256_block_data_order_neon
#endif

View File

@ -9,12 +9,12 @@
extern "C" {
#endif
/* Crypto++ modifed sha256_block_data_order to pass caps as a parameter. */
/* Crypto++ modifed cryptogams_sha256_block_data_order to pass caps as a parameter. */
/* Also see https://github.com/weidai11/cryptopp/issues/846. */
void sha256_block_data_order(void *state, const void *data, size_t blocks);
void cryptogams_sha256_block_data_order(void *state, const void *data, size_t blocks);
/* Cryptogams arm caps */
#define ARMV7_NEON (1<<0)
#define CRYPTOGAMS_ARMV7_NEON (1<<0)
#ifdef __cplusplus
}

View File

@ -64,7 +64,7 @@
# endif
# endif
# define ARMV7_NEON (1<<0)
# define CRYPTOGAMS_ARMV7_NEON (1<<0)
@ JW, MAY 2019: End defines from taken from arm_arch.h
@ Back to original Cryptogams code
@ -137,16 +137,16 @@ K512:
.skip 32
.align 5
.globl sha512_block_data_order
.type sha512_block_data_order,%function
.globl cryptogams_sha512_block_data_order
.type cryptogams_sha512_block_data_order,%function
sha512_block_data_order:
.Lsha512_block_data_order:
cryptogams_sha512_block_data_order:
.Lcryptogams_sha512_block_data_order:
#if __ARM_ARCH__<7 && !defined(__thumb2__)
sub r3,pc,#8 @ sha512_block_data_order
sub r3,pc,#8 @ cryptogams_sha512_block_data_order
#else
adr r3,.Lsha512_block_data_order
adr r3,.Lcryptogams_sha512_block_data_order
#endif
add r2,r1,r2,lsl#7 @ len to point at the end of inp
@ -526,17 +526,17 @@ sha512_block_data_order:
moveq pc,lr @ be binary compatible with V4, yet
.word 0xe12fff1e @ interoperable with Thumb ISA:-)
#endif
.size sha512_block_data_order,.-sha512_block_data_order
.size cryptogams_sha512_block_data_order,.-cryptogams_sha512_block_data_order
#if __ARM_MAX_ARCH__>=7
.arch armv7-a
.fpu neon
.align 4
.globl sha512_block_data_order_neon
.type sha512_block_data_order_neon,%function
.globl cryptogams_sha512_block_data_order_neon
.type cryptogams_sha512_block_data_order_neon,%function
sha512_block_data_order_neon:
cryptogams_sha512_block_data_order_neon:
dmb @ errata #451034 on early Cortex A8
add r2,r1,r2,lsl#7 @ len to point at the end of inp
@ -1857,5 +1857,5 @@ sha512_block_data_order_neon:
bne .Loop_neon
vldmia sp!,{d8-d15}
bx lr @ .word 0xe12fff1e
.size sha512_block_data_order_neon,.-sha512_block_data_order_neon
.size cryptogams_sha512_block_data_order_neon,.-cryptogams_sha512_block_data_order_neon
#endif

View File

@ -9,12 +9,12 @@
extern "C" {
#endif
/* Crypto++ modifed sha512_block_data_order to pass caps as a parameter. */
/* Crypto++ modifed cryptogams_sha512_block_data_order to pass caps as a parameter. */
/* Also see https://github.com/weidai11/cryptopp/issues/846. */
void sha512_block_data_order(void *state, const void *data, size_t blocks);
void cryptogams_sha512_block_data_order(void *state, const void *data, size_t blocks);
/* Cryptogams arm caps */
#define ARMV7_NEON (1<<0)
#define CRYPTOGAMS_ARMV7_NEON (1<<0)
#ifdef __cplusplus
}