include/crypto/poly1305.h

Source file repositories/reference/linux-study-clean/include/crypto/poly1305.h

File Facts

System
Linux kernel
Corpus path
include/crypto/poly1305.h
Extension
.h
Size
1494 bytes
Lines
68
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.

Dependency Surface

Detected Declarations

Annotated Snippet

struct poly1305_key {
	union {
		u32 r[5];
		u64 r64[3];
	};
};

struct poly1305_core_key {
	struct poly1305_key key;
	struct poly1305_key precomputed_s;
};

struct poly1305_state {
	union {
		u32 h[5];
		u64 h64[3];
	};
};

/* Combined state for block function. */
struct poly1305_block_state {
	/* accumulator */
	struct poly1305_state h;
	/* key */
	union {
		struct poly1305_key opaque_r[CONFIG_CRYPTO_LIB_POLY1305_RSIZE];
		struct poly1305_core_key core_r;
	};
};

struct poly1305_desc_ctx {
	/* partial buffer */
	u8 buf[POLY1305_BLOCK_SIZE];
	/* bytes used in partial buffer */
	unsigned int buflen;
	/* finalize key */
	u32 s[4];
	struct poly1305_block_state state;
};

void poly1305_init(struct poly1305_desc_ctx *desc,
		   const u8 key[at_least POLY1305_KEY_SIZE]);
void poly1305_update(struct poly1305_desc_ctx *desc,
		     const u8 *src, unsigned int nbytes);
void poly1305_final(struct poly1305_desc_ctx *desc, u8 *digest);

#endif

Annotation

Implementation Notes