Replaced system SQLite with SQLCipher to support encrypted database

This commit is contained in:
Oleksii Zghurskyi
2025-06-07 18:11:17 +03:00
parent f4198d62a7
commit 177d74700f
534 changed files with 362771 additions and 21 deletions

View File

@@ -0,0 +1,39 @@
/* LibTomCrypt, modular cryptographic library -- Tom St Denis */
/* SPDX-License-Identifier: Unlicense */
#include "tomcrypt_private.h"
/**
@file pkcs_1_i2osp.c
Integer to Octet I2OSP, Tom St Denis
*/
#ifdef LTC_PKCS_1
/* always stores the same # of bytes, pads with leading zero bytes
as required
*/
/**
PKCS #1 Integer to binary
@param n The integer to store
@param modulus_len The length of the RSA modulus
@param out [out] The destination for the integer
@return CRYPT_OK if successful
*/
int pkcs_1_i2osp(void *n, unsigned long modulus_len, unsigned char *out)
{
unsigned long size;
size = ltc_mp_unsigned_bin_size(n);
if (size > modulus_len) {
return CRYPT_BUFFER_OVERFLOW;
}
/* store it */
zeromem(out, modulus_len);
return ltc_mp_to_unsigned_bin(n, out+(modulus_len-size));
}
#endif /* LTC_PKCS_1 */