rsakey-builtin.c.inc (f09744ddc2424bc6a76702e1951a8d24917062d6) rsakey-builtin.c.inc (5f4059ef33e927ce9f72cb60000efa156566cd5c)
1/*
2 * QEMU Crypto akcipher algorithms
3 *
4 * Copyright (c) 2022 Bytedance
5 * Author: lei he <helei.sig11@bytedance.com>
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public

--- 169 unchanged lines hidden (view full) ---

178 return NULL;
179}
180
181QCryptoAkCipherRSAKey *qcrypto_akcipher_rsakey_parse(
182 QCryptoAkCipherKeyType type, const uint8_t *key,
183 size_t keylen, Error **errp)
184{
185 switch (type) {
1/*
2 * QEMU Crypto akcipher algorithms
3 *
4 * Copyright (c) 2022 Bytedance
5 * Author: lei he <helei.sig11@bytedance.com>
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public

--- 169 unchanged lines hidden (view full) ---

178 return NULL;
179}
180
181QCryptoAkCipherRSAKey *qcrypto_akcipher_rsakey_parse(
182 QCryptoAkCipherKeyType type, const uint8_t *key,
183 size_t keylen, Error **errp)
184{
185 switch (type) {
186 case QCRYPTO_AKCIPHER_KEY_TYPE_PRIVATE:
186 case QCRYPTO_AK_CIPHER_KEY_TYPE_PRIVATE:
187 return qcrypto_builtin_rsa_private_key_parse(key, keylen, errp);
188
187 return qcrypto_builtin_rsa_private_key_parse(key, keylen, errp);
188
189 case QCRYPTO_AKCIPHER_KEY_TYPE_PUBLIC:
189 case QCRYPTO_AK_CIPHER_KEY_TYPE_PUBLIC:
190 return qcrypto_builtin_rsa_public_key_parse(key, keylen, errp);
191
192 default:
193 error_setg(errp, "Unknown key type: %d", type);
194 return NULL;
195 }
196}
190 return qcrypto_builtin_rsa_public_key_parse(key, keylen, errp);
191
192 default:
193 error_setg(errp, "Unknown key type: %d", type);
194 return NULL;
195 }
196}