diff options
author | Rutger Broekhoff | 2024-04-27 02:25:17 +0200 |
---|---|---|
committer | Rutger Broekhoff | 2024-04-27 02:25:17 +0200 |
commit | 66e0e65fd17d50d857ce5e4f3e8d56b3a795845c (patch) | |
tree | f437a03e561074f43438e6ea0d07f55e150cdce7 /tool/znk.zig | |
parent | a50016c7481b4c8613e03af136d93309c6b30400 (diff) | |
download | zig-nkeys-66e0e65fd17d50d857ce5e4f3e8d56b3a795845c.tar.gz zig-nkeys-66e0e65fd17d50d857ce5e4f3e8d56b3a795845c.zip |
Diffstat (limited to 'tool/znk.zig')
-rw-r--r-- | tool/znk.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tool/znk.zig b/tool/znk.zig index af8f757..c50edae 100644 --- a/tool/znk.zig +++ b/tool/znk.zig | |||
@@ -438,7 +438,7 @@ fn PrefixKeyGenerator(comptime EntropyReaderType: type) type { | |||
438 | fn generatePrivate(self: *Self) !void { | 438 | fn generatePrivate(self: *Self) !void { |
439 | var rr = RandomReader.init(&std.crypto.random); | 439 | var rr = RandomReader.init(&std.crypto.random); |
440 | var brr = io.BufferedReader(1024 * 4096, @TypeOf(rr.reader())){ .unbuffered_reader = rr.reader() }; | 440 | var brr = io.BufferedReader(1024 * 4096, @TypeOf(rr.reader())){ .unbuffered_reader = rr.reader() }; |
441 | while (!self.done.load(.SeqCst)) { | 441 | while (!self.done.load(.seq_cst)) { |
442 | const gen_result = if (self.entropy) |entropy| | 442 | const gen_result = if (self.entropy) |entropy| |
443 | nkeys.SeedKeyPair.generateWithCustomEntropy(self.role, entropy) | 443 | nkeys.SeedKeyPair.generateWithCustomEntropy(self.role, entropy) |
444 | else | 444 | else |
@@ -447,7 +447,7 @@ fn PrefixKeyGenerator(comptime EntropyReaderType: type) type { | |||
447 | 447 | ||
448 | var public_key = kp.publicKeyText(); | 448 | var public_key = kp.publicKeyText(); |
449 | if (mem.startsWith(u8, public_key[1..], self.prefix)) { | 449 | if (mem.startsWith(u8, public_key[1..], self.prefix)) { |
450 | if (self.done.swap(true, .SeqCst)) return; // another thread is already done | 450 | if (self.done.swap(true, .seq_cst)) return; // another thread is already done |
451 | 451 | ||
452 | info("{s}", .{kp.seedText()}); | 452 | info("{s}", .{kp.seedText()}); |
453 | info("{s}", .{public_key}); | 453 | info("{s}", .{public_key}); |