Lines Matching refs:alg
72 size_t qcrypto_cipher_get_block_len(QCryptoCipherAlgo alg) in qcrypto_cipher_get_block_len() argument
74 assert(alg < G_N_ELEMENTS(alg_key_len)); in qcrypto_cipher_get_block_len()
75 return alg_block_len[alg]; in qcrypto_cipher_get_block_len()
79 size_t qcrypto_cipher_get_key_len(QCryptoCipherAlgo alg) in qcrypto_cipher_get_key_len() argument
81 assert(alg < G_N_ELEMENTS(alg_key_len)); in qcrypto_cipher_get_key_len()
82 return alg_key_len[alg]; in qcrypto_cipher_get_key_len()
86 size_t qcrypto_cipher_get_iv_len(QCryptoCipherAlgo alg, in qcrypto_cipher_get_iv_len() argument
89 if (alg >= G_N_ELEMENTS(alg_block_len)) { in qcrypto_cipher_get_iv_len()
97 return alg_block_len[alg]; in qcrypto_cipher_get_iv_len()
104 qcrypto_cipher_validate_key_length(QCryptoCipherAlgo alg, in qcrypto_cipher_validate_key_length() argument
109 if ((unsigned)alg >= QCRYPTO_CIPHER_ALGO__MAX) { in qcrypto_cipher_validate_key_length()
111 alg); in qcrypto_cipher_validate_key_length()
116 if (alg == QCRYPTO_CIPHER_ALGO_DES || in qcrypto_cipher_validate_key_length()
117 alg == QCRYPTO_CIPHER_ALGO_3DES) { in qcrypto_cipher_validate_key_length()
126 if (alg_key_len[alg] != (nkey / 2)) { in qcrypto_cipher_validate_key_length()
128 nkey, alg_key_len[alg] * 2); in qcrypto_cipher_validate_key_length()
132 if (alg_key_len[alg] != nkey) { in qcrypto_cipher_validate_key_length()
134 nkey, alg_key_len[alg]); in qcrypto_cipher_validate_key_length()
151 QCryptoCipher *qcrypto_cipher_new(QCryptoCipherAlgo alg, in qcrypto_cipher_new() argument
159 cipher = qcrypto_afalg_cipher_ctx_new(alg, mode, key, nkey, NULL); in qcrypto_cipher_new()
163 cipher = qcrypto_cipher_ctx_new(alg, mode, key, nkey, errp); in qcrypto_cipher_new()
169 cipher->alg = alg; in qcrypto_cipher_new()