Skip to content

Commit

Permalink
port to work with flipper and fbt
Browse files Browse the repository at this point in the history
  • Loading branch information
xtruan committed Mar 1, 2023
1 parent b323627 commit f889441
Show file tree
Hide file tree
Showing 43 changed files with 40 additions and 17,970 deletions.
38 changes: 19 additions & 19 deletions crypto/aes/aestst.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,25 +96,25 @@ unsigned char res[3][32] =
}
};

void cycles(volatile uint64_t *rtn)
{
#if defined( _MSCVER )
__asm // read the Pentium Time Stamp Counter
{ cpuid
rdtsc
mov ecx,rtn
mov [ecx],eax
mov [ecx+4],edx
cpuid
}
#elif defined( __GNUC__ )
#if defined(__aarch64__)
__asm__ __volatile__("mrs %0, cntvct_el0": "=r" (*rtn));
#else
__asm__ __volatile__("rdtsc": "=A" (*rtn));
#endif
#endif
}
// void cycles(volatile uint64_t *rtn)
// {
// #if defined( _MSCVER )
// __asm // read the Pentium Time Stamp Counter
// { cpuid
// rdtsc
// mov ecx,rtn
// mov [ecx],eax
// mov [ecx+4],edx
// cpuid
// }
// #elif defined( __GNUC__ )
// #if defined(__aarch64__)
// __asm__ __volatile__("mrs %0, cntvct_el0": "=r" (*rtn));
// #else
// __asm__ __volatile__("rdtsc": "=A" (*rtn));
// #endif
// #endif
// }

int main(void)
{ unsigned char out[32], ret[32], err = 0;
Expand Down
2 changes: 1 addition & 1 deletion crypto/ed25519-donna/ed25519-donna-impl-base.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <assert.h>
#include "ed25519-donna.h"
#include "memzero.h"
#include "../memzero.h"

/* sqrt(x) is such an integer y that 0 <= y <= p - 1, y % 2 = 0, and y^2 = x (mod p). */
/* d = -121665 / 121666 */
Expand Down
4 changes: 2 additions & 2 deletions crypto/ed25519-donna/ed25519-donna-impl-base.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ void ge25519_nielsadd2_p1p1(ge25519_p1p1 *r, const ge25519 *p, const ge25519_nie
#endif

/* computes [s1]p1 + [s2]p2 */
#if USE_MONERO
//#if USE_MONERO
void ge25519_double_scalarmult_vartime2(ge25519 *r, const ge25519 *p1, const bignum256modm s1, const ge25519 *p2, const bignum256modm s2);
#endif
//#endif

void ge25519_pnielsadd_p1p1(ge25519_p1p1 *r, const ge25519 *p, const ge25519_pniels *q, unsigned char signbit);

Expand Down
2 changes: 1 addition & 1 deletion crypto/ed25519-donna/ed25519-hash-custom-keccak.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#ifndef ED25519_HASH_CUSTOM
#define ED25519_HASH_CUSTOM

#include "sha3.h"
#include "../sha3.h"

#define ed25519_hash_context SHA3_CTX
#define ed25519_hash_init(ctx) keccak_512_Init(ctx)
Expand Down
2 changes: 1 addition & 1 deletion crypto/ed25519-donna/ed25519-hash-custom-sha3.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#ifndef ED25519_HASH_CUSTOM
#define ED25519_HASH_CUSTOM

#include "sha3.h"
#include "../sha3.h"

#define ed25519_hash_context SHA3_CTX
#define ed25519_hash_init(ctx) sha3_512_Init(ctx)
Expand Down
2 changes: 1 addition & 1 deletion crypto/ed25519-donna/ed25519-hash-custom.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#ifndef ED25519_HASH_CUSTOM
#define ED25519_HASH_CUSTOM

#include "sha2.h"
#include "../sha2.h"

#define ed25519_hash_context SHA512_CTX
#define ed25519_hash_init(ctx) sha512_Init(ctx)
Expand Down
4 changes: 2 additions & 2 deletions crypto/ed25519-donna/ed25519.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
#include "ed25519.h"

#include "ed25519-hash-custom.h"
#include "rand.h"
#include "memzero.h"
#include "../rand.h"
#include "../memzero.h"

/*
Generates a (extsk[0..31]) and aExt (extsk[32..63])
Expand Down
2 changes: 1 addition & 1 deletion crypto/ed25519-donna/ed25519.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef ED25519_H
#define ED25519_H

#include "options.h"
#include "../options.h"

#if defined(__cplusplus)
extern "C" {
Expand Down
105 changes: 0 additions & 105 deletions crypto/fuzzer/README.md

This file was deleted.

Loading

0 comments on commit f889441

Please sign in to comment.