/* Copyright (c) (2016,2017,2019) Apple Inc. All rights reserved. * * corecrypto is licensed under Apple Inc.’s Internal Use License Agreement (which * is contained in the License.txt file distributed with corecrypto) and only to * people who accept that license. IMPORTANT: Any license rights granted to you by * Apple Inc. (if any) are limited to internal use within your organization only on * devices and computers you own or control, for the sole purpose of verifying the * security characteristics and correct functioning of the Apple Software. You may * not, directly or indirectly, redistribute the Apple Software or any portions thereof. */ #include #include #include #include #include "thermalCrypto.h" #include // extern void ccdigest_update(const struct ccdigest_info *di, ccdigest_ctx_t ctx, size_t len, const void *data); typedef struct { unsigned int adler; unsigned char *InputBuffer; unsigned int length; } Parameters; static void Driver(unsigned int iterations, void *parameters) { Parameters *p = (Parameters *) parameters; while (iterations--) { p -> adler = (unsigned int) adler32(p->adler, p->InputBuffer, p->length); } } extern uint32_t single_test; void thermalAdler32(uint32_t ITERATIONS, uint32_t data_size) { uint32_t i; double TotalTime = 0; unsigned int adler = 1; uint8_t *msg; if (!(msg = malloc(data_size))) { fprintf(stderr,"error : malloc %d \n", data_size); exit(1); } if (!single_test) for (i=0;i