Let us walk on the 3-isogeny graph
Loading...
Searching...
No Matches
hal.h File Reference
#include <stdint.h>
#include <stddef.h>
Include dependency graph for hal.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum  clock_mode { CLOCK_FAST , CLOCK_BENCHMARK }

Functions

void hal_setup (const enum clock_mode clock)
uint64_t hal_get_time (void)

Enumeration Type Documentation

◆ clock_mode

enum clock_mode
Enumerator
CLOCK_FAST 
CLOCK_BENCHMARK 

Definition at line 7 of file hal.h.

7 {
10};
@ CLOCK_BENCHMARK
Definition hal.h:9
@ CLOCK_FAST
Definition hal.h:8

Function Documentation

◆ hal_get_time()

uint64_t hal_get_time ( void )

Definition at line 10 of file hal-cortexa.c.

10 {
11
12#if defined(AARCH64)
13
14 uint64_t t;
15 asm volatile("mrs %0, PMCCNTR_EL0":"=r"(t));
16 return t;
17
18 #elif defined(ARMV7l)
19
20 // TODO: this is actually a 32-bit counter, so it won't work for very long running schemes
21 // need to figure out a way to get a 64-bit cycle counter
22 unsigned int cc;
23 asm volatile("mrc p15, 0, %0, c9, c13, 0" : "=r"(cc));
24 return cc;
25 #elif defined(x8664)
26 uint64_t t = 0;
27 return t;
28#else
29 uint64_t t = 0;
30 return t;
31#endif
32}

Referenced by cshake128_simple(), cshake128_simple_absorb(), cshake128_simple_squeezeblocks(), cshake256_simple(), cshake256_simple_absorb(), cshake256_simple_squeezeblocks(), sha3_256(), sha3_256_inc_absorb(), sha3_256_inc_finalize(), sha3_256_inc_init(), sha3_384(), sha3_384_inc_absorb(), sha3_384_inc_finalize(), sha3_384_inc_init(), sha3_512(), sha3_512_inc_absorb(), sha3_512_inc_finalize(), sha3_512_inc_init(), shake128(), shake128_absorb(), shake128_inc_absorb(), shake128_inc_finalize(), shake128_inc_init(), shake128_inc_squeeze(), shake128_squeezeblocks(), shake256(), shake256_absorb(), shake256_inc_absorb(), shake256_inc_finalize(), shake256_inc_init(), shake256_inc_squeeze(), and shake256_squeezeblocks().

Here is the caller graph for this function:

◆ hal_setup()

void hal_setup ( const enum clock_mode clock)

Definition at line 4 of file hal-cortexa.c.

5{
6 (void)clock;
7 //TODO figure out if we need to do someting here
8}