1 /* 2 * Copyright 2014-2022 The GmSSL Project. All Rights Reserved. 3 * 4 * Licensed under the Apache License, Version 2.0 (the License); you may 5 * not use this file except in compliance with the License. 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 */ 9 10 11 #ifndef GMSSL_MEM_H 12 #define GMSSL_MEM_H 13 14 #include <stdint.h> 15 #include <stddef.h> // where size_t from 16 17 18 void memxor(void *r, const void *a, size_t len); 19 void gmssl_memxor(void *r, const void *a, const void *b, size_t len); 20 21 int gmssl_secure_memcmp(const volatile void * volatile in_a, const volatile void * volatile in_b, size_t len); 22 void gmssl_secure_clear(void *ptr, size_t len); 23 24 int mem_is_zero(const uint8_t *buf, size_t len); // FIXME: uint8_t * to void * 25 26 #endif 27 28