Compare commits

..

No commits in common. "2e328beaa5f3edb445e79c6679c8e3508b149a9c" and "5f73c01368f418bb9b5186ff14bcdacb044fcb86" have entirely different histories.

5 changed files with 7 additions and 2212 deletions

View File

@ -698,13 +698,13 @@ const save = "\x1b7";
const restore = "\x1b8";
const finish_sync = "\x1b[?2026l";
const progress_remove = "\x1b]9;4;0\x1b\\";
const @"progress_normal {d}" = "\x1b]9;4;1;{d}\x1b\\";
const @"progress_error {d}" = "\x1b]9;4;2;{d}\x1b\\";
const progress_pulsing = "\x1b]9;4;3\x1b\\";
const progress_pulsing_error = "\x1b]9;4;2\x1b\\";
const progress_normal_100 = "\x1b]9;4;1;100\x1b\\";
const progress_error_100 = "\x1b]9;4;2;100\x1b\\";
const progress_remove = "\x1b]9;4;0\x07";
const @"progress_normal {d}" = "\x1b]9;4;1;{d}\x07";
const @"progress_error {d}" = "\x1b]9;4;2;{d}\x07";
const progress_pulsing = "\x1b]9;4;3\x07";
const progress_pulsing_error = "\x1b]9;4;2\x07";
const progress_normal_100 = "\x1b]9;4;1;100\x07";
const progress_error_100 = "\x1b]9;4;2;100\x07";
const TreeSymbol = enum {
/// ├─

View File

@ -30,7 +30,6 @@ const hashes = [_]Crypto{
Crypto{ .ty = crypto.hash.sha3.Shake256, .name = "shake-256" },
Crypto{ .ty = crypto.hash.sha3.TurboShake128(null), .name = "turboshake-128" },
Crypto{ .ty = crypto.hash.sha3.TurboShake256(null), .name = "turboshake-256" },
Crypto{ .ty = crypto.hash.sha3.KT128, .name = "kt128" },
Crypto{ .ty = crypto.hash.blake2.Blake2s256, .name = "blake2s" },
Crypto{ .ty = crypto.hash.blake2.Blake2b512, .name = "blake2b" },
Crypto{ .ty = crypto.hash.Blake3, .name = "blake3" },
@ -38,7 +37,6 @@ const hashes = [_]Crypto{
const parallel_hashes = [_]Crypto{
Crypto{ .ty = crypto.hash.Blake3, .name = "blake3-parallel" },
Crypto{ .ty = crypto.hash.sha3.KT128, .name = "kt128-parallel" },
};
const block_size: usize = 8 * 8192;

File diff suppressed because it is too large Load Diff

View File

@ -4,8 +4,6 @@ const assert = std.debug.assert;
const math = std.math;
const mem = std.mem;
const kangarootwelve = @import("kangarootwelve.zig");
const KeccakState = std.crypto.core.keccak.State;
pub const Sha3_224 = Keccak(1600, 224, 0x06, 24);
@ -28,9 +26,6 @@ pub const KMac256 = KMac(256);
pub const TupleHash128 = TupleHash(128);
pub const TupleHash256 = TupleHash(256);
pub const KT128 = kangarootwelve.KT128;
pub const KT256 = kangarootwelve.KT256;
/// TurboSHAKE128 is a XOF (a secure hash function with a variable output length), with a 128 bit security level.
/// It is based on the same permutation as SHA3 and SHAKE128, but which much higher performance.
/// The delimiter is 0x1f by default, but can be changed for context-separation.
@ -486,10 +481,6 @@ pub const NistLengthEncoding = enum {
const htest = @import("test.zig");
test {
_ = kangarootwelve;
}
test "sha3-224 single" {
try htest.assertEqualHash(Sha3_224, "6b4e03423667dbb73b6e15454f0eb1abd4597f9a1b078e3f5b5a6bc7", "");
try htest.assertEqualHash(Sha3_224, "e642824c3f8cf24ad09234ee7d3c766fc9a3a5168d0c94ad73b46fdf", "abc");

View File

@ -768,21 +768,6 @@ pub const Header = struct {
};
}
pub fn iterateDynamicSectionBuffer(
h: *const Header,
buf: []const u8,
offset: u64,
size: u64,
) DynamicSectionBufferIterator {
return .{
.is_64 = h.is_64,
.endian = h.endian,
.offset = offset,
.end_offset = offset + size,
.buf = buf,
};
}
pub const ReadError = Io.Reader.Error || error{
InvalidElfMagic,
InvalidElfVersion,
@ -978,23 +963,6 @@ pub const DynamicSectionIterator = struct {
}
};
pub const DynamicSectionBufferIterator = struct {
is_64: bool,
endian: Endian,
offset: u64,
end_offset: u64,
buf: []const u8,
pub fn next(it: *DynamicSectionBufferIterator) !?Elf64_Dyn {
if (it.offset >= it.end_offset) return null;
const size: u64 = if (it.is_64) @sizeOf(Elf64_Dyn) else @sizeOf(Elf32_Dyn);
defer it.offset += size;
var reader: std.Io.Reader = .fixed(it.buf[it.offset..]);
return try takeDynamicSection(&reader, it.is_64, it.endian);
}
};
pub fn takeDynamicSection(reader: *Io.Reader, is_64: bool, endian: Endian) !Elf64_Dyn {
if (is_64) {
const dyn = try reader.takeStruct(Elf64_Dyn, endian);