pub enum GcmBlockMulEnhancement {
None,
M0TableAndRTable,
M4BitTables,
MTables,
}Expand description
Block multiplication enhancement variants used for GHASH calculation.
Which in turn used for calculation of authentication tag.
https://luca-giuzzi.unibs.it/corsi/Support/papers-cryptography/gcm-spec.pdf
None - regular multiplication. Requires just 16B (aes cipher key) per session, i.e. cca 67M sessions per 1GB of memory
worst throughput
M0TableAndRTable - cca 3.7 times faster then regular multiplication.
Needs 4096Bytes per key, i.e. cca 262K key per 1GB of memory.
M4BitTables - cca 6.9 times faster then regular multiplication.
Needs 8192Bytes per key, i.e. cca 131K keys per 1GB of memory.
MTables - cca 9 times faster then regular multiplication.
Needs 65535Bytes per key, i.e. cca 16,4K keys per 1GB of memory.
Variants§
Implementations§
Source§impl GcmBlockMulEnhancement
impl GcmBlockMulEnhancement
Sourcepub fn to_mul_fn(&self, cipher_key: &[u8]) -> Box<GcmBlockMulFn>
pub fn to_mul_fn(&self, cipher_key: &[u8]) -> Box<GcmBlockMulFn>
Converts BlockMulEnhancement to a Box<BlockMulFn> function which represents block multiplication
and needs to be passed to encrypt and decrypt functions within a session.
block_mul_enhancementBlockMulEnhancement base on time-memory tradeoffscipher_keycipher key of underlying block cipher protocol i.e. AES