golang.zx2c4.com/wireguard/windows@v0.5.4-0.20230123132234-dcc0eb72a04b/installer/fetcher/crypto.h (about) 1 /* SPDX-License-Identifier: GPL-2.0 2 * 3 * Copyright (C) 2020-2022 Jason A. Donenfeld. All Rights Reserved. 4 */ 5 6 #ifndef _CRYPTO_H 7 #define _CRYPTO_H 8 9 #include <stdint.h> 10 #include <stddef.h> 11 #include <stdbool.h> 12 13 struct blake2b256_state { 14 uint64_t h[8]; 15 uint64_t t[2]; 16 uint64_t f[2]; 17 uint8_t buf[128]; 18 size_t buflen; 19 }; 20 21 void blake2b256_init(struct blake2b256_state *state); 22 void blake2b256_update(struct blake2b256_state *state, const uint8_t *in, 23 unsigned int inlen); 24 void blake2b256_final(struct blake2b256_state *state, uint8_t out[32]); 25 26 bool ed25519_verify(const uint8_t signature[64], const uint8_t public_key[32], 27 const void *message, size_t message_size); 28 29 #endif