Zig 0.17.0-dev (Split by item)

This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig library itself.

ctr

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.

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

File

lib/std/crypto/modes.zig:13

Code

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