include/crypto/internal/rsa.h
Source file repositories/reference/linux-study-clean/include/crypto/internal/rsa.h
File Facts
- System
- Linux kernel
- Corpus path
include/crypto/internal/rsa.h- Extension
.h- Size
- 2290 bytes
- Lines
- 87
- Domain
- Repository Root And Misc
- Bucket
- include
- Inferred role
- Repository Root And Misc: implementation source
- Status
- source implementation candidate
Why This File Exists
Top-level or miscellaneous repository surface. Use this as map coverage unless a later manual pass promotes the file into a deeper subsystem dossier.
- Top-level or miscellaneous repository surface. Use this as map coverage unless a later manual pass promotes the file into a deeper subsystem dossier.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/types.hcrypto/akcipher.h
Detected Declarations
struct rsa_keyfunction rsa_set_key
Annotated Snippet
struct rsa_key {
const u8 *n;
const u8 *e;
const u8 *d;
const u8 *p;
const u8 *q;
const u8 *dp;
const u8 *dq;
const u8 *qinv;
size_t n_sz;
size_t e_sz;
size_t d_sz;
size_t p_sz;
size_t q_sz;
size_t dp_sz;
size_t dq_sz;
size_t qinv_sz;
};
int rsa_parse_pub_key(struct rsa_key *rsa_key, const void *key,
unsigned int key_len);
int rsa_parse_priv_key(struct rsa_key *rsa_key, const void *key,
unsigned int key_len);
#define RSA_PUB (true)
#define RSA_PRIV (false)
static inline int rsa_set_key(struct crypto_akcipher *child,
unsigned int *key_size, bool is_pubkey,
const void *key, unsigned int keylen)
{
int err;
*key_size = 0;
if (is_pubkey)
err = crypto_akcipher_set_pub_key(child, key, keylen);
else
err = crypto_akcipher_set_priv_key(child, key, keylen);
if (err)
return err;
/* Find out new modulus size from rsa implementation */
err = crypto_akcipher_maxsize(child);
if (err > PAGE_SIZE)
return -ENOTSUPP;
*key_size = err;
return 0;
}
extern struct crypto_template rsa_pkcs1pad_tmpl;
extern struct crypto_template rsassa_pkcs1_tmpl;
#endif
Annotation
- Immediate include surface: `linux/types.h`, `crypto/akcipher.h`.
- Detected declarations: `struct rsa_key`, `function rsa_set_key`.
- Atlas domain: Repository Root And Misc / include.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.