- check_builtin:
-
- for (i = 0; silc_cipher_builtin_list[i].name; i++)
- if (!strcmp(silc_cipher_builtin_list[i].name, name))
- break;
-
- if (silc_cipher_builtin_list[i].name == NULL) {
- silc_free(*new_cipher);
- *new_cipher = NULL;
- return FALSE;
- }
-
- /* Set the pointers */
- (*new_cipher)->cipher = &silc_cipher_builtin_list[i];
- (*new_cipher)->context =
- silc_calloc(1, (*new_cipher)->cipher->context_len());
- (*new_cipher)->set_iv = silc_cipher_set_iv;
- (*new_cipher)->get_iv = silc_cipher_get_iv;
- (*new_cipher)->get_key_len = silc_cipher_get_key_len;
- (*new_cipher)->get_block_len = silc_cipher_get_block_len;
- memset(&(*new_cipher)->iv, 0, sizeof((*new_cipher)->iv));
-
- return TRUE;