mirror of
https://github.com/cryb-to/cryb-to.git
synced 2024-12-25 14:01:07 +00:00
Catch up with toolchain changes.
This commit is contained in:
parent
96a5cef4ba
commit
7885f54152
18 changed files with 84 additions and 75 deletions
|
@ -1,5 +1,5 @@
|
|||
AC_PREREQ([2.63])
|
||||
AC_INIT([cryb.to], [0.20190326], [des@des.no], [cryb-to], [http://cryb.to/])
|
||||
AC_PREREQ([2.69])
|
||||
AC_INIT([cryb.to], [0.20220916], [des@des.no], [cryb-to], [http://cryb.to/])
|
||||
AC_CONFIG_SRCDIR([include/cryb/core.h])
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
AM_INIT_AUTOMAKE([foreign no-dist-gzip dist-xz])
|
||||
|
@ -14,10 +14,9 @@ AM_MAINTAINER_MODE([enable])
|
|||
# C compiler and features
|
||||
AC_LANG(C)
|
||||
AC_PROG_CC([clang gcc cc])
|
||||
AC_PROG_CC_STDC
|
||||
AC_PROG_CPP
|
||||
AC_PROG_CXX([clang++ g++ c++])
|
||||
AC_GNU_SOURCE
|
||||
AC_USE_SYSTEM_EXTENSIONS
|
||||
AC_C_CONST
|
||||
AC_C_RESTRICT
|
||||
AC_C_VOLATILE
|
||||
|
|
|
@ -623,10 +623,10 @@ cipher_algorithm aes128_cipher = {
|
|||
.contextlen = sizeof(aes_ctx),
|
||||
.blocklen = AES_BLOCK_LEN,
|
||||
.keylen = 128 / 8,
|
||||
.init = (cipher_init_func)aes_init,
|
||||
.encrypt = (cipher_encrypt_func)aes_encrypt,
|
||||
.decrypt = (cipher_decrypt_func)aes_decrypt,
|
||||
.finish = (cipher_finish_func)aes_finish,
|
||||
.init = (cipher_init_func)(void *)aes_init,
|
||||
.encrypt = (cipher_encrypt_func)(void *)aes_encrypt,
|
||||
.decrypt = (cipher_decrypt_func)(void *)aes_decrypt,
|
||||
.finish = (cipher_finish_func)(void *)aes_finish,
|
||||
};
|
||||
|
||||
cipher_algorithm aes192_cipher = {
|
||||
|
@ -634,10 +634,10 @@ cipher_algorithm aes192_cipher = {
|
|||
.contextlen = sizeof(aes_ctx),
|
||||
.blocklen = AES_BLOCK_LEN,
|
||||
.keylen = 192 / 8,
|
||||
.init = (cipher_init_func)aes_init,
|
||||
.encrypt = (cipher_encrypt_func)aes_encrypt,
|
||||
.decrypt = (cipher_decrypt_func)aes_decrypt,
|
||||
.finish = (cipher_finish_func)aes_finish,
|
||||
.init = (cipher_init_func)(void *)aes_init,
|
||||
.encrypt = (cipher_encrypt_func)(void *)aes_encrypt,
|
||||
.decrypt = (cipher_decrypt_func)(void *)aes_decrypt,
|
||||
.finish = (cipher_finish_func)(void *)aes_finish,
|
||||
};
|
||||
|
||||
cipher_algorithm aes256_cipher = {
|
||||
|
@ -645,8 +645,8 @@ cipher_algorithm aes256_cipher = {
|
|||
.contextlen = sizeof(aes_ctx),
|
||||
.blocklen = AES_BLOCK_LEN,
|
||||
.keylen = 256 / 8,
|
||||
.init = (cipher_init_func)aes_init,
|
||||
.encrypt = (cipher_encrypt_func)aes_encrypt,
|
||||
.decrypt = (cipher_decrypt_func)aes_decrypt,
|
||||
.finish = (cipher_finish_func)aes_finish,
|
||||
.init = (cipher_init_func)(void *)aes_init,
|
||||
.encrypt = (cipher_encrypt_func)(void *)aes_encrypt,
|
||||
.decrypt = (cipher_decrypt_func)(void *)aes_decrypt,
|
||||
.finish = (cipher_finish_func)(void *)aes_finish,
|
||||
};
|
||||
|
|
|
@ -194,9 +194,9 @@ cipher_algorithm chacha_cipher = {
|
|||
.contextlen = sizeof(chacha_ctx),
|
||||
.blocklen = 64,
|
||||
.keylen = 32,
|
||||
.init = (cipher_init_func)chacha_init,
|
||||
.keystream = (cipher_keystream_func)chacha_keystream,
|
||||
.encrypt = (cipher_encrypt_func)chacha_encrypt,
|
||||
.decrypt = (cipher_decrypt_func)chacha_decrypt,
|
||||
.finish = (cipher_finish_func)chacha_finish,
|
||||
.init = (cipher_init_func)(void *)chacha_init,
|
||||
.keystream = (cipher_keystream_func)(void *)chacha_keystream,
|
||||
.encrypt = (cipher_encrypt_func)(void *)chacha_encrypt,
|
||||
.decrypt = (cipher_decrypt_func)(void *)chacha_decrypt,
|
||||
.finish = (cipher_finish_func)(void *)chacha_finish,
|
||||
};
|
||||
|
|
|
@ -440,10 +440,10 @@ cipher_algorithm des56_cipher = {
|
|||
.contextlen = sizeof(des_ctx),
|
||||
.blocklen = DES_BLOCK_LEN,
|
||||
.keylen = DES_BLOCK_LEN,
|
||||
.init = (cipher_init_func)des_init,
|
||||
.encrypt = (cipher_encrypt_func)des_encrypt,
|
||||
.decrypt = (cipher_decrypt_func)des_decrypt,
|
||||
.finish = (cipher_finish_func)des_finish,
|
||||
.init = (cipher_init_func)(void *)des_init,
|
||||
.encrypt = (cipher_encrypt_func)(void *)des_encrypt,
|
||||
.decrypt = (cipher_decrypt_func)(void *)des_decrypt,
|
||||
.finish = (cipher_finish_func)(void *)des_finish,
|
||||
};
|
||||
|
||||
cipher_algorithm des112_cipher = {
|
||||
|
@ -451,10 +451,10 @@ cipher_algorithm des112_cipher = {
|
|||
.contextlen = sizeof(des_ctx),
|
||||
.blocklen = DES_BLOCK_LEN,
|
||||
.keylen = DES_BLOCK_LEN * 2,
|
||||
.init = (cipher_init_func)des_init,
|
||||
.encrypt = (cipher_encrypt_func)des_encrypt,
|
||||
.decrypt = (cipher_decrypt_func)des_decrypt,
|
||||
.finish = (cipher_finish_func)des_finish,
|
||||
.init = (cipher_init_func)(void *)des_init,
|
||||
.encrypt = (cipher_encrypt_func)(void *)des_encrypt,
|
||||
.decrypt = (cipher_decrypt_func)(void *)des_decrypt,
|
||||
.finish = (cipher_finish_func)(void *)des_finish,
|
||||
};
|
||||
|
||||
cipher_algorithm des168_cipher = {
|
||||
|
@ -462,8 +462,8 @@ cipher_algorithm des168_cipher = {
|
|||
.contextlen = sizeof(des_ctx),
|
||||
.blocklen = DES_BLOCK_LEN,
|
||||
.keylen = DES_BLOCK_LEN * 3,
|
||||
.init = (cipher_init_func)des_init,
|
||||
.encrypt = (cipher_encrypt_func)des_encrypt,
|
||||
.decrypt = (cipher_decrypt_func)des_decrypt,
|
||||
.finish = (cipher_finish_func)des_finish,
|
||||
.init = (cipher_init_func)(void *)des_init,
|
||||
.encrypt = (cipher_encrypt_func)(void *)des_encrypt,
|
||||
.decrypt = (cipher_decrypt_func)(void *)des_decrypt,
|
||||
.finish = (cipher_finish_func)(void *)des_finish,
|
||||
};
|
||||
|
|
|
@ -116,9 +116,9 @@ cipher_algorithm rc4_cipher = {
|
|||
.contextlen = sizeof(rc4_ctx),
|
||||
.blocklen = 1,
|
||||
.keylen = 0,
|
||||
.init = (cipher_init_func)rc4_init,
|
||||
.keystream = (cipher_keystream_func)rc4_keystream,
|
||||
.encrypt = (cipher_encrypt_func)rc4_encrypt,
|
||||
.decrypt = (cipher_decrypt_func)rc4_decrypt,
|
||||
.finish = (cipher_finish_func)rc4_finish,
|
||||
.init = (cipher_init_func)(void *)rc4_init,
|
||||
.keystream = (cipher_keystream_func)(void *)rc4_keystream,
|
||||
.encrypt = (cipher_encrypt_func)(void *)rc4_encrypt,
|
||||
.decrypt = (cipher_decrypt_func)(void *)rc4_decrypt,
|
||||
.finish = (cipher_finish_func)(void *)rc4_finish,
|
||||
};
|
||||
|
|
|
@ -194,9 +194,9 @@ cipher_algorithm salsa_cipher = {
|
|||
.contextlen = sizeof(salsa_ctx),
|
||||
.blocklen = 64,
|
||||
.keylen = 32,
|
||||
.init = (cipher_init_func)salsa_init,
|
||||
.keystream = (cipher_keystream_func)salsa_keystream,
|
||||
.encrypt = (cipher_encrypt_func)salsa_encrypt,
|
||||
.decrypt = (cipher_decrypt_func)salsa_decrypt,
|
||||
.finish = (cipher_finish_func)salsa_finish,
|
||||
.init = (cipher_init_func)(void *)salsa_init,
|
||||
.keystream = (cipher_keystream_func)(void *)salsa_keystream,
|
||||
.encrypt = (cipher_encrypt_func)(void *)salsa_encrypt,
|
||||
.decrypt = (cipher_decrypt_func)(void *)salsa_decrypt,
|
||||
.finish = (cipher_finish_func)(void *)salsa_finish,
|
||||
};
|
||||
|
|
|
@ -174,8 +174,8 @@ digest_algorithm md2_digest = {
|
|||
.contextlen = sizeof(md2_ctx),
|
||||
.blocklen = MD2_BLOCK_LEN,
|
||||
.digestlen = MD2_DIGEST_LEN,
|
||||
.init = (digest_init_func)md2_init,
|
||||
.update = (digest_update_func)md2_update,
|
||||
.final = (digest_final_func)md2_final,
|
||||
.complete = (digest_complete_func)md2_complete,
|
||||
.init = (digest_init_func)(void *)md2_init,
|
||||
.update = (digest_update_func)(void *)md2_update,
|
||||
.final = (digest_final_func)(void *)md2_final,
|
||||
.complete = (digest_complete_func)(void *)md2_complete,
|
||||
};
|
||||
|
|
|
@ -196,8 +196,8 @@ digest_algorithm md4_digest = {
|
|||
.contextlen = sizeof(md4_ctx),
|
||||
.blocklen = MD4_BLOCK_LEN,
|
||||
.digestlen = MD4_DIGEST_LEN,
|
||||
.init = (digest_init_func)md4_init,
|
||||
.update = (digest_update_func)md4_update,
|
||||
.final = (digest_final_func)md4_final,
|
||||
.complete = (digest_complete_func)md4_complete,
|
||||
.init = (digest_init_func)(void *)md4_init,
|
||||
.update = (digest_update_func)(void *)md4_update,
|
||||
.final = (digest_final_func)(void *)md4_final,
|
||||
.complete = (digest_complete_func)(void *)md4_complete,
|
||||
};
|
||||
|
|
|
@ -243,8 +243,8 @@ digest_algorithm md5_digest = {
|
|||
.contextlen = sizeof(md5_ctx),
|
||||
.blocklen = MD5_BLOCK_LEN,
|
||||
.digestlen = MD5_DIGEST_LEN,
|
||||
.init = (digest_init_func)md5_init,
|
||||
.update = (digest_update_func)md5_update,
|
||||
.final = (digest_final_func)md5_final,
|
||||
.complete = (digest_complete_func)md5_complete,
|
||||
.init = (digest_init_func)(void *)md5_init,
|
||||
.update = (digest_update_func)(void *)md5_update,
|
||||
.final = (digest_final_func)(void *)md5_final,
|
||||
.complete = (digest_complete_func)(void *)md5_complete,
|
||||
};
|
||||
|
|
|
@ -235,8 +235,8 @@ digest_algorithm sha1_digest = {
|
|||
.contextlen = sizeof(sha1_ctx),
|
||||
.blocklen = SHA1_BLOCK_LEN,
|
||||
.digestlen = SHA1_DIGEST_LEN,
|
||||
.init = (digest_init_func)sha1_init,
|
||||
.update = (digest_update_func)sha1_update,
|
||||
.final = (digest_final_func)sha1_final,
|
||||
.complete = (digest_complete_func)sha1_complete,
|
||||
.init = (digest_init_func)(void *)sha1_init,
|
||||
.update = (digest_update_func)(void *)sha1_update,
|
||||
.final = (digest_final_func)(void *)sha1_final,
|
||||
.complete = (digest_complete_func)(void *)sha1_complete,
|
||||
};
|
||||
|
|
|
@ -290,8 +290,8 @@ digest_algorithm sha224_digest = {
|
|||
.contextlen = sizeof(sha224_ctx),
|
||||
.blocklen = SHA224_BLOCK_LEN,
|
||||
.digestlen = SHA224_DIGEST_LEN,
|
||||
.init = (digest_init_func)sha224_init,
|
||||
.update = (digest_update_func)sha224_update,
|
||||
.final = (digest_final_func)sha224_final,
|
||||
.complete = (digest_complete_func)sha224_complete,
|
||||
.init = (digest_init_func)(void *)sha224_init,
|
||||
.update = (digest_update_func)(void *)sha224_update,
|
||||
.final = (digest_final_func)(void *)sha224_final,
|
||||
.complete = (digest_complete_func)(void *)sha224_complete,
|
||||
};
|
||||
|
|
|
@ -289,8 +289,8 @@ digest_algorithm sha256_digest = {
|
|||
.contextlen = sizeof(sha256_ctx),
|
||||
.blocklen = SHA256_BLOCK_LEN,
|
||||
.digestlen = SHA256_DIGEST_LEN,
|
||||
.init = (digest_init_func)sha256_init,
|
||||
.update = (digest_update_func)sha256_update,
|
||||
.final = (digest_final_func)sha256_final,
|
||||
.complete = (digest_complete_func)sha256_complete,
|
||||
.init = (digest_init_func)(void *)sha256_init,
|
||||
.update = (digest_update_func)(void *)sha256_update,
|
||||
.final = (digest_final_func)(void *)sha256_final,
|
||||
.complete = (digest_complete_func)(void *)sha256_complete,
|
||||
};
|
||||
|
|
|
@ -291,8 +291,8 @@ digest_algorithm sha384_digest = {
|
|||
.contextlen = sizeof(sha384_ctx),
|
||||
.blocklen = SHA384_BLOCK_LEN,
|
||||
.digestlen = SHA384_DIGEST_LEN,
|
||||
.init = (digest_init_func)sha384_init,
|
||||
.update = (digest_update_func)sha384_update,
|
||||
.final = (digest_final_func)sha384_final,
|
||||
.complete = (digest_complete_func)sha384_complete,
|
||||
.init = (digest_init_func)(void *)sha384_init,
|
||||
.update = (digest_update_func)(void *)sha384_update,
|
||||
.final = (digest_final_func)(void *)sha384_final,
|
||||
.complete = (digest_complete_func)(void *)sha384_complete,
|
||||
};
|
||||
|
|
|
@ -291,8 +291,8 @@ digest_algorithm sha512_digest = {
|
|||
.contextlen = sizeof(sha512_ctx),
|
||||
.blocklen = SHA512_BLOCK_LEN,
|
||||
.digestlen = SHA512_DIGEST_LEN,
|
||||
.init = (digest_init_func)sha512_init,
|
||||
.update = (digest_update_func)sha512_update,
|
||||
.final = (digest_final_func)sha512_final,
|
||||
.complete = (digest_complete_func)sha512_complete,
|
||||
.init = (digest_init_func)(void *)sha512_init,
|
||||
.update = (digest_update_func)(void *)sha512_update,
|
||||
.final = (digest_final_func)(void *)sha512_final,
|
||||
.complete = (digest_complete_func)(void *)sha512_complete,
|
||||
};
|
||||
|
|
|
@ -75,12 +75,16 @@ base32_encode(const uint8_t *in, size_t ilen, char *out, size_t *olen)
|
|||
switch (ilen) {
|
||||
case 4:
|
||||
bits |= (uint64_t)in[3] << 8;
|
||||
/* fall through */
|
||||
case 3:
|
||||
bits |= (uint64_t)in[2] << 16;
|
||||
/* fall through */
|
||||
case 2:
|
||||
bits |= (uint64_t)in[1] << 24;
|
||||
/* fall through */
|
||||
case 1:
|
||||
bits |= (uint64_t)in[0] << 32;
|
||||
break;
|
||||
CRYB_NO_DEFAULT_CASE;
|
||||
}
|
||||
*out++ = b32enc[bits >> 35 & 0x1f];
|
||||
|
|
|
@ -71,8 +71,10 @@ base64_encode(const uint8_t *in, size_t ilen, char *out, size_t *olen)
|
|||
switch (ilen) {
|
||||
case 2:
|
||||
bits |= (uint32_t)in[1] << 8;
|
||||
/* fall through */
|
||||
case 1:
|
||||
bits |= (uint32_t)in[0] << 16;
|
||||
break;
|
||||
CRYB_NO_DEFAULT_CASE;
|
||||
}
|
||||
*out++ = b64enc[bits >> 18 & 0x3f];
|
||||
|
|
|
@ -78,8 +78,10 @@ murmur3_32_hash(const void *data, size_t len, uint32_t seed)
|
|||
switch (res) {
|
||||
case 3:
|
||||
k |= bytes[2] << 16;
|
||||
/* fall through */
|
||||
case 2:
|
||||
k |= bytes[1] << 8;
|
||||
/* fall through */
|
||||
case 1:
|
||||
k |= bytes[0];
|
||||
k *= 0xcc9e2d51;
|
||||
|
|
|
@ -63,8 +63,10 @@ mpi_load(cryb_mpi *X, const uint8_t *a, size_t len)
|
|||
switch (len) {
|
||||
case 3:
|
||||
X->words[i] |= a[len - 3] << 16;
|
||||
/* fall through */
|
||||
case 2:
|
||||
X->words[i] |= a[len - 2] << 8;
|
||||
/* fall through */
|
||||
case 1:
|
||||
X->words[i] |= a[len - 1];
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue