/* * Max length of a SPU message header. Used to allocate a buffer where * the SPU message header is constructed. Can be used for either a SPU-M * header or a SPU2 header. * For SPU-M, sum of the following: * MH - 4 bytes * EMH - 4 * SCTX - 3 + * max auth key len - 64 * max cipher key len - 264 (RC4) * max IV len - 16 * BDESC - 12 * BD header - 4 * Total: 371 * * For SPU2, FMD_SIZE (32) plus lengths of hash and cipher keys, * hash and cipher IVs. If SPU2 does not support RC4, then
*/ #define SPU_HEADER_ALLOC_LEN (SPU_REQ_FIXED_LEN + MAX_KEY_SIZE + \
MAX_KEY_SIZE + MAX_IV_SIZE)
/* * Response message header length. Normally MH, EMH, BD header, but when * BD_SUPPRESS is used for hash requests, there is no BD header.
*/ #define SPU_RESP_HDR_LEN 12 #define SPU_HASH_RESP_HDR_LEN 8
/* * Max value that can be represented in the Payload Length field of the BD * header. This is a 16-bit field.
*/ #define SPUM_NS2_MAX_PAYLOAD (BIT(16) - 1)
/* * NSP SPU is limited to ~9KB because of FA2 FIFO size limitations; * Set MAX_PAYLOAD to 8k to allow for addition of header, digest, etc. * and stay within limitation.
*/
#define SPUM_NSP_MAX_PAYLOAD 8192
/* Buffer Descriptor Header [BDESC]. SPU in big-endian mode. */ struct BDESC_HEADER {
__be16 offset_mac; /* word 0 [31-16] */
__be16 length_mac; /* word 0 [15-0] */
__be16 offset_crypto; /* word 1 [31-16] */
__be16 length_crypto; /* word 1 [15-0] */
__be16 offset_icv; /* word 2 [31-16] */
__be16 offset_iv; /* word 2 [15-0] */
};
/* Buffer Data Header [BD]. SPU in big-endian mode. */ struct BD_HEADER {
__be16 size;
__be16 prev_length;
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.