fn ctr(comptime BlockCipher: anytype, block_cipher: BlockCipher, dst: []u8, src: []const u8, iv: [BlockCipher.block_length]u8, endian: std.builtin.Endian) void

Counter mode.

This mode creates a key stream by encrypting an incrementing counter using a block cipher, and adding it to the source material.

Important: the counter mode doesn’t provide authenticated encryption: the ciphertext can be trivially modified without this being detected. As a result, applications should generally never use it directly, but only in a construction that includes a MAC.

Parameters

BlockCipher: anytype,
block_cipher: BlockCipher,
dst: []u8,
src: []const u8,
iv: [BlockCipher.block_length]u8,
endian: std.builtin.Endian,