mirror of
https://github.com/guanzhi/GmSSL.git
synced 2026-05-06 16:36:16 +08:00
add gmssl command
This commit is contained in:
@@ -55,6 +55,9 @@
|
||||
#define GMSSL_GF128_H
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
@@ -62,28 +65,24 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define GMSSL_HAVE_UINT128
|
||||
#ifdef GMSSL_HAVE_UINT128
|
||||
typedef unsigned __int128 gf128_t;
|
||||
#else
|
||||
//typedef unsigned __int128 gf128_t;
|
||||
|
||||
typedef struct {
|
||||
uint64_t hi;
|
||||
uint64_t lo;
|
||||
} gf128_t;
|
||||
#endif
|
||||
|
||||
|
||||
// Note: send by value is comptabile with uint128_t and sse2
|
||||
gf128_t gf128_from_hex(const char *s);
|
||||
int gf128_equ_hex(gf128_t a, const char *s);
|
||||
|
||||
gf128_t gf128_zero(void);
|
||||
|
||||
gf128_t gf128_add(gf128_t a, gf128_t b);
|
||||
gf128_t gf128_mul(gf128_t a, gf128_t b);
|
||||
gf128_t gf128_mul2(gf128_t a);
|
||||
gf128_t gf128_from_bytes(const uint8_t p[16]);
|
||||
void gf128_to_bytes(gf128_t a, uint8_t p[16]);
|
||||
|
||||
void gf128_print(const char *s, gf128_t a);
|
||||
int gf128_print(FILE *fp, int fmt ,int ind, const char *label, gf128_t a);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
Reference in New Issue
Block a user