Upgrade libtomcrypt

This commit is contained in:
2025-10-24 19:33:21 +03:00
parent d770dd8df3
commit acc69bb8ad
157 changed files with 922 additions and 761 deletions

View File

@@ -669,7 +669,7 @@ int ECB_TEST(void)
unsigned char tmp[2][16];
int i, y;
for (i = 0; i < (int)(sizeof(tests)/sizeof(tests[0])); i++) {
for (i = 0; i < (int)LTC_ARRAY_SIZE(tests); i++) {
zeromem(&key, sizeof(key));
if ((err = rijndael_setup(tests[i].key, tests[i].keylen, 0, &key)) != CRYPT_OK) {
return err;

View File

@@ -63,10 +63,19 @@ static LTC_INLINE int s_aesni_is_supported(void)
a = 1;
c = 0;
#if defined(_MSC_VER) && !defined(__clang__)
int arr[4];
__cpuidex(arr, a, c);
a = arr[0];
b = arr[1];
c = arr[2];
d = arr[3];
#else
__asm__ volatile ("cpuid"
:"=a"(a), "=b"(b), "=c"(c), "=d"(d)
:"a"(a), "c"(c)
);
#endif
is_supported = ((c >> 19) & 1) && ((c >> 25) & 1);
initialized = 1;
@@ -189,7 +198,7 @@ int AES_TEST(void)
int y;
#endif
for (i = 0; i < (int)(sizeof(tests)/sizeof(tests[0])); i++) {
for (i = 0; i < (int)LTC_ARRAY_SIZE(tests); i++) {
zeromem(&key, sizeof(key));
if ((err = AES_SETUP(tests[i].key, tests[i].keylen, 0, &key)) != CRYPT_OK) {
return err;

View File

@@ -313,7 +313,7 @@ int aesni_test(void)
unsigned char tmp[2][16];
int i, y;
for (i = 0; i < (int)(sizeof(tests)/sizeof(tests[0])); i++) {
for (i = 0; i < (int)LTC_ARRAY_SIZE(tests); i++) {
zeromem(&key, sizeof(key));
if ((err = aesni_setup(tests[i].key, tests[i].keylen, 0, &key)) != CRYPT_OK) {
return err;