Skip to content

Commit

Permalink
Keplr format: Benchmark only Raw, print algorithm detail
Browse files Browse the repository at this point in the history
  • Loading branch information
solardiz committed Jan 17, 2024
1 parent ec25402 commit e0a147f
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions src/keplr_fmt_plug.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted.
///////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////

#if FMT_EXTERNS_H
extern struct fmt_main fmt_keplr;
Expand All @@ -31,13 +31,24 @@ john_register_one(&fmt_keplr);
#include "sha2.h"
#include "jumbo.h"

/* SCRYPT_ALGORITHM_NAME taken from restic_fmt_plug.c */
#if !defined(JOHN_NO_SIMD) && defined(__XOP__)
#define SCRYPT_ALGORITHM_NAME "Salsa20/8 128/128 XOP"
#elif !defined(JOHN_NO_SIMD) && defined(__AVX__)
#define SCRYPT_ALGORITHM_NAME "Salsa20/8 128/128 AVX"
#elif !defined(JOHN_NO_SIMD) && defined(__SSE2__)
#define SCRYPT_ALGORITHM_NAME "Salsa20/8 128/128 SSE2"
#else
#define SCRYPT_ALGORITHM_NAME "Salsa20/8 32/" ARCH_BITS_STR
#endif

#define FORMAT_NAME "Keplr Wallet"
#define FORMAT_LABEL "keplr"
#define FORMAT_TAG "$keplr$"
#define TAG_LENGTH (sizeof(FORMAT_TAG) - 1)
#define ALGORITHM_NAME "scrypt sha256"
#define BENCHMARK_COMMENT ""
#define BENCHMARK_LENGTH 7
#define ALGORITHM_NAME "scrypt " SCRYPT_ALGORITHM_NAME ", SHA256 32/" ARCH_BITS_STR
#define BENCHMARK_COMMENT " (131072, 8, 1)"
#define BENCHMARK_LENGTH 0x507
#define BINARY_SIZE 0
#define BINARY_ALIGN 1
#define SALT_SIZE sizeof(struct custom_salt)
Expand All @@ -46,7 +57,7 @@ john_register_one(&fmt_keplr);
#define MIN_KEYS_PER_CRYPT 1
#define MAX_KEYS_PER_CRYPT 1

#define OMP_SCALE 1 // MKPC and scale tuned for i7
#define OMP_SCALE 1

static int max_threads;
static yescrypt_local_t *local;
Expand Down

0 comments on commit e0a147f

Please sign in to comment.