Merge Starkware branch

This commit is contained in:
BTChip github
2020-06-27 13:24:04 +02:00
parent 20e9f46c3c
commit 8d0544bf68
57 changed files with 4439 additions and 2243 deletions

25
src/stark_crypto.h Normal file
View File

@@ -0,0 +1,25 @@
#ifndef __STARK_CRYPTO_H__
#define __STARK_CRYPTO_H__
#include <stdbool.h>
#include <stdint.h>
#include <string.h>
#include "os.h"
#include "cx.h"
/* EC points */
#define FIELD_ELEMENT_SIZE (32)
#define EC_POINT_SIZE (2 * FIELD_ELEMENT_SIZE + 1)
typedef unsigned char FieldElement[FIELD_ELEMENT_SIZE];
typedef unsigned char ECPoint[EC_POINT_SIZE];
void pedersen(FieldElement res, /* out */
FieldElement a, FieldElement b);
int stark_sign(uint8_t *signautre, /* out */
uint8_t *privateKeyData, FieldElement token1,
FieldElement token2, FieldElement msg);
#endif