crypto/ec/curve448/eddsa.c:229: error: MEMORY_LEAK
  memory dynamically allocated by call to `EVP_MD_CTX_new()` at line 135, column 27 is not reachable after line 229, column 5.
Showing all 71 steps of the trace


crypto/ec/curve448/eddsa.c:126:1: start of procedure c448_ed448_sign()
124.   }
125.   
126. > c448_error_t c448_ed448_sign(
127.                           uint8_t signature[EDDSA_448_SIGNATURE_BYTES],
128.                           const uint8_t privkey[EDDSA_448_PRIVATE_BYTES],

crypto/ec/curve448/eddsa.c:135:5: 
133.   {
134.       curve448_scalar_t secret_scalar;
135. >     EVP_MD_CTX *hashctx = EVP_MD_CTX_new();
136.       c448_error_t ret = C448_FAILURE;
137.       curve448_scalar_t nonce_scalar;

crypto/evp/digest.c:44:1: start of procedure EVP_MD_CTX_new()
  42.   }
  43.   
  44. > EVP_MD_CTX *EVP_MD_CTX_new(void)
  45.   {
  46.       return OPENSSL_zalloc(sizeof(EVP_MD_CTX));

crypto/evp/digest.c:46:5: 
  44.   EVP_MD_CTX *EVP_MD_CTX_new(void)
  45.   {
  46. >     return OPENSSL_zalloc(sizeof(EVP_MD_CTX));
  47.   }
  48.   

crypto/mem.c:221:1: start of procedure CRYPTO_zalloc()
    219.   }
    220.   
    221. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
    222.   {
    223.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:223:5: 
    221.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
    222.   {
    223. >     void *ret = CRYPTO_malloc(num, file, line);
    224.   
    225.       FAILTEST();

crypto/mem.c:192:1: start of procedure CRYPTO_malloc()
      190.   #endif
      191.   
      192. > void *CRYPTO_malloc(size_t num, const char *file, int line)
      193.   {
      194.       void *ret = NULL;

crypto/mem.c:194:5: 
      192.   void *CRYPTO_malloc(size_t num, const char *file, int line)
      193.   {
      194. >     void *ret = NULL;
      195.   
      196.       INCREMENT(malloc_count);

crypto/mem.c:197:9: Taking false branch
      195.   
      196.       INCREMENT(malloc_count);
      197.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                     ^
      198.           return malloc_impl(num, file, line);
      199.   

crypto/mem.c:200:9: Taking false branch
      198.           return malloc_impl(num, file, line);
      199.   
      200.       if (num == 0)
                     ^
      201.           return NULL;
      202.   

crypto/mem.c:204:5: 
      202.   
      203.       FAILTEST();
      204. >     allow_customize = 0;
      205.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
      206.       if (call_malloc_debug) {

crypto/mem.c:214:5: 
      212.       }
      213.   #else
      214. >     (void)(file); (void)(line);
      215.       ret = malloc(num);
      216.   #endif

crypto/mem.c:214:19: 
      212.       }
      213.   #else
      214. >     (void)(file); (void)(line);
      215.       ret = malloc(num);
      216.   #endif

crypto/mem.c:215:5: 
      213.   #else
      214.       (void)(file); (void)(line);
      215. >     ret = malloc(num);
      216.   #endif
      217.   

crypto/mem.c:218:5: 
      216.   #endif
      217.   
      218. >     return ret;
      219.   }
      220.   

crypto/mem.c:219:1: return from a call to CRYPTO_malloc
      217.   
      218.       return ret;
      219. > }
      220.   
      221.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/mem.c:226:9: Taking true branch
    224.   
    225.       FAILTEST();
    226.       if (ret != NULL)
                   ^
    227.           memset(ret, 0, num);
    228.       return ret;

crypto/mem.c:227:9: 
    225.       FAILTEST();
    226.       if (ret != NULL)
    227. >         memset(ret, 0, num);
    228.       return ret;
    229.   }

crypto/mem.c:228:5: 
    226.       if (ret != NULL)
    227.           memset(ret, 0, num);
    228. >     return ret;
    229.   }
    230.   

crypto/mem.c:229:1: return from a call to CRYPTO_zalloc
    227.           memset(ret, 0, num);
    228.       return ret;
    229. > }
    230.   
    231.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)

crypto/evp/digest.c:47:1: return from a call to EVP_MD_CTX_new
  45.   {
  46.       return OPENSSL_zalloc(sizeof(EVP_MD_CTX));
  47. > }
  48.   
  49.   void EVP_MD_CTX_free(EVP_MD_CTX *ctx)

crypto/ec/curve448/eddsa.c:136:5: 
134.       curve448_scalar_t secret_scalar;
135.       EVP_MD_CTX *hashctx = EVP_MD_CTX_new();
136. >     c448_error_t ret = C448_FAILURE;
137.       curve448_scalar_t nonce_scalar;
138.       uint8_t nonce_point[EDDSA_448_PUBLIC_BYTES] = { 0 };

crypto/ec/curve448/eddsa.c:138:5: 
136.       c448_error_t ret = C448_FAILURE;
137.       curve448_scalar_t nonce_scalar;
138. >     uint8_t nonce_point[EDDSA_448_PUBLIC_BYTES] = { 0 };
139.       unsigned int c;
140.       curve448_scalar_t challenge_scalar;

crypto/ec/curve448/eddsa.c:142:9: Taking false branch
140.       curve448_scalar_t challenge_scalar;
141.   
142.       if (hashctx == NULL)
               ^
143.           return C448_FAILURE;
144.   

crypto/ec/curve448/eddsa.c:152:14: 
150.           uint8_t expanded[EDDSA_448_PRIVATE_BYTES * 2];
151.   
152. >         if (!oneshot_hash(expanded, sizeof(expanded), privkey,
153.                             EDDSA_448_PRIVATE_BYTES))
154.               goto err;

crypto/ec/curve448/eddsa.c:22:1: start of procedure oneshot_hash()
  20.   #define COFACTOR 4
  21.   
  22. > static c448_error_t oneshot_hash(uint8_t *out, size_t outlen,
  23.                                    const uint8_t *in, size_t inlen)
  24.   {

crypto/ec/curve448/eddsa.c:25:5: 
  23.                                    const uint8_t *in, size_t inlen)
  24.   {
  25. >     EVP_MD_CTX *hashctx = EVP_MD_CTX_new();
  26.   
  27.       if (hashctx == NULL)

crypto/evp/digest.c:44:1: start of procedure EVP_MD_CTX_new()
    42.   }
    43.   
    44. > EVP_MD_CTX *EVP_MD_CTX_new(void)
    45.   {
    46.       return OPENSSL_zalloc(sizeof(EVP_MD_CTX));

crypto/evp/digest.c:46:5: 
    44.   EVP_MD_CTX *EVP_MD_CTX_new(void)
    45.   {
    46. >     return OPENSSL_zalloc(sizeof(EVP_MD_CTX));
    47.   }
    48.   

crypto/mem.c:221:1: start of procedure CRYPTO_zalloc()
      219.   }
      220.   
      221. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
      222.   {
      223.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:223:5: 
      221.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
      222.   {
      223. >     void *ret = CRYPTO_malloc(num, file, line);
      224.   
      225.       FAILTEST();

crypto/mem.c:192:1: start of procedure CRYPTO_malloc()
        190.   #endif
        191.   
        192. > void *CRYPTO_malloc(size_t num, const char *file, int line)
        193.   {
        194.       void *ret = NULL;

crypto/mem.c:194:5: 
        192.   void *CRYPTO_malloc(size_t num, const char *file, int line)
        193.   {
        194. >     void *ret = NULL;
        195.   
        196.       INCREMENT(malloc_count);

crypto/mem.c:197:9: Taking true branch
        195.   
        196.       INCREMENT(malloc_count);
        197.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                       ^
        198.           return malloc_impl(num, file, line);
        199.   

crypto/mem.c:197:32: Taking true branch
        195.   
        196.       INCREMENT(malloc_count);
        197.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                                              ^
        198.           return malloc_impl(num, file, line);
        199.   

crypto/mem.c:198:9: Skipping __function_pointer__(): unresolved function pointer
        196.       INCREMENT(malloc_count);
        197.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
        198.           return malloc_impl(num, file, line);
                       ^
        199.   
        200.       if (num == 0)

crypto/mem.c:219:1: return from a call to CRYPTO_malloc
        217.   
        218.       return ret;
        219. > }
        220.   
        221.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/mem.c:226:9: Taking true branch
      224.   
      225.       FAILTEST();
      226.       if (ret != NULL)
                     ^
      227.           memset(ret, 0, num);
      228.       return ret;

crypto/mem.c:227:9: 
      225.       FAILTEST();
      226.       if (ret != NULL)
      227. >         memset(ret, 0, num);
      228.       return ret;
      229.   }

crypto/mem.c:228:5: 
      226.       if (ret != NULL)
      227.           memset(ret, 0, num);
      228. >     return ret;
      229.   }
      230.   

crypto/mem.c:229:1: return from a call to CRYPTO_zalloc
      227.           memset(ret, 0, num);
      228.       return ret;
      229. > }
      230.   
      231.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)

crypto/evp/digest.c:47:1: return from a call to EVP_MD_CTX_new
    45.   {
    46.       return OPENSSL_zalloc(sizeof(EVP_MD_CTX));
    47. > }
    48.   
    49.   void EVP_MD_CTX_free(EVP_MD_CTX *ctx)

crypto/ec/curve448/eddsa.c:27:9: Taking false branch
  25.       EVP_MD_CTX *hashctx = EVP_MD_CTX_new();
  26.   
  27.       if (hashctx == NULL)
                ^
  28.           return C448_FAILURE;
  29.   

crypto/ec/curve448/eddsa.c:30:10: 
  28.           return C448_FAILURE;
  29.   
  30. >     if (!EVP_DigestInit_ex(hashctx, EVP_shake256(), NULL)
  31.               || !EVP_DigestUpdate(hashctx, in, inlen)
  32.               || !EVP_DigestFinalXOF(hashctx, out, outlen)) {

crypto/evp/m_sha3.c:182:1: start of procedure EVP_shake256()
    180.   
    181.   EVP_MD_SHAKE(128)
    182. > EVP_MD_SHAKE(256)

crypto/evp/m_sha3.c:182:1: return from a call to EVP_shake256
    180.   
    181.   EVP_MD_SHAKE(128)
    182. > EVP_MD_SHAKE(256)

crypto/ec/curve448/eddsa.c:30:10: Taking true branch
  28.           return C448_FAILURE;
  29.   
  30.       if (!EVP_DigestInit_ex(hashctx, EVP_shake256(), NULL)
                 ^
  31.               || !EVP_DigestUpdate(hashctx, in, inlen)
  32.               || !EVP_DigestFinalXOF(hashctx, out, outlen)) {

crypto/ec/curve448/eddsa.c:33:9: 
  31.               || !EVP_DigestUpdate(hashctx, in, inlen)
  32.               || !EVP_DigestFinalXOF(hashctx, out, outlen)) {
  33. >         EVP_MD_CTX_free(hashctx);
  34.           return C448_FAILURE;
  35.       }

crypto/evp/digest.c:49:1: start of procedure EVP_MD_CTX_free()
    47.   }
    48.   
    49. > void EVP_MD_CTX_free(EVP_MD_CTX *ctx)
    50.   {
    51.       EVP_MD_CTX_reset(ctx);

crypto/evp/digest.c:51:5: Skipping EVP_MD_CTX_reset(): empty list of specs
    49.   void EVP_MD_CTX_free(EVP_MD_CTX *ctx)
    50.   {
    51.       EVP_MD_CTX_reset(ctx);
              ^
    52.       OPENSSL_free(ctx);
    53.   }

crypto/evp/digest.c:52:5: 
    50.   {
    51.       EVP_MD_CTX_reset(ctx);
    52. >     OPENSSL_free(ctx);
    53.   }
    54.   

crypto/mem.c:289:1: start of procedure CRYPTO_free()
      287.   }
      288.   
      289. > void CRYPTO_free(void *str, const char *file, int line)
      290.   {
      291.       INCREMENT(free_count);

crypto/mem.c:292:9: Taking false branch
      290.   {
      291.       INCREMENT(free_count);
      292.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                     ^
      293.           free_impl(str, file, line);
      294.           return;

crypto/mem.c:306:5: 
      304.       }
      305.   #else
      306. >     free(str);
      307.   #endif
      308.   }

crypto/mem.c:308:1: return from a call to CRYPTO_free
      306.       free(str);
      307.   #endif
      308. > }
      309.   
      310.   void CRYPTO_clear_free(void *str, size_t num, const char *file, int line)

crypto/evp/digest.c:53:1: return from a call to EVP_MD_CTX_free
    51.       EVP_MD_CTX_reset(ctx);
    52.       OPENSSL_free(ctx);
    53. > }
    54.   
    55.   int EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type)

crypto/ec/curve448/eddsa.c:34:9: 
  32.               || !EVP_DigestFinalXOF(hashctx, out, outlen)) {
  33.           EVP_MD_CTX_free(hashctx);
  34. >         return C448_FAILURE;
  35.       }
  36.   

crypto/ec/curve448/eddsa.c:39:1: return from a call to oneshot_hash
  37.       EVP_MD_CTX_free(hashctx);
  38.       return C448_SUCCESS;
  39. > }
  40.   
  41.   static void clamp(uint8_t secret_scalar_ser[EDDSA_448_PRIVATE_BYTES])

crypto/ec/curve448/eddsa.c:152:14: Taking true branch
150.           uint8_t expanded[EDDSA_448_PRIVATE_BYTES * 2];
151.   
152.           if (!oneshot_hash(expanded, sizeof(expanded), privkey,
                    ^
153.                             EDDSA_448_PRIVATE_BYTES))
154.               goto err;

crypto/ec/curve448/eddsa.c:228:2: 
226.   
227.       ret = C448_SUCCESS;
228. >  err:
229.       EVP_MD_CTX_free(hashctx);
230.       return ret;

crypto/ec/curve448/eddsa.c:229:5: 
227.       ret = C448_SUCCESS;
228.    err:
229. >     EVP_MD_CTX_free(hashctx);
230.       return ret;
231.   }

crypto/evp/digest.c:49:1: start of procedure EVP_MD_CTX_free()
  47.   }
  48.   
  49. > void EVP_MD_CTX_free(EVP_MD_CTX *ctx)
  50.   {
  51.       EVP_MD_CTX_reset(ctx);

crypto/evp/digest.c:51:5: Skipping EVP_MD_CTX_reset(): empty list of specs
  49.   void EVP_MD_CTX_free(EVP_MD_CTX *ctx)
  50.   {
  51.       EVP_MD_CTX_reset(ctx);
            ^
  52.       OPENSSL_free(ctx);
  53.   }

crypto/evp/digest.c:52:5: 
  50.   {
  51.       EVP_MD_CTX_reset(ctx);
  52. >     OPENSSL_free(ctx);
  53.   }
  54.   

crypto/mem.c:289:1: start of procedure CRYPTO_free()
    287.   }
    288.   
    289. > void CRYPTO_free(void *str, const char *file, int line)
    290.   {
    291.       INCREMENT(free_count);

crypto/mem.c:292:9: Taking true branch
    290.   {
    291.       INCREMENT(free_count);
    292.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                   ^
    293.           free_impl(str, file, line);
    294.           return;

crypto/mem.c:292:30: Taking true branch
    290.   {
    291.       INCREMENT(free_count);
    292.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                                        ^
    293.           free_impl(str, file, line);
    294.           return;

crypto/mem.c:293:9: Skipping __function_pointer__(): unresolved function pointer
    291.       INCREMENT(free_count);
    292.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
    293.           free_impl(str, file, line);
                   ^
    294.           return;
    295.       }

crypto/mem.c:294:9: 
    292.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
    293.           free_impl(str, file, line);
    294. >         return;
    295.       }
    296.   

crypto/mem.c:308:1: return from a call to CRYPTO_free
    306.       free(str);
    307.   #endif
    308. > }
    309.   
    310.   void CRYPTO_clear_free(void *str, size_t num, const char *file, int line)

crypto/evp/digest.c:53:1: return from a call to EVP_MD_CTX_free
  51.       EVP_MD_CTX_reset(ctx);
  52.       OPENSSL_free(ctx);
  53. > }
  54.   
  55.   int EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type)

c448_error_t c448_ed448_sign(
                        uint8_t signature[EDDSA_448_SIGNATURE_BYTES],
                        const uint8_t privkey[EDDSA_448_PRIVATE_BYTES],
                        const uint8_t pubkey[EDDSA_448_PUBLIC_BYTES],
                        const uint8_t *message, size_t message_len,
                        uint8_t prehashed, const uint8_t *context,
                        size_t context_len)
{
    curve448_scalar_t secret_scalar;
    EVP_MD_CTX *hashctx = EVP_MD_CTX_new();
    c448_error_t ret = C448_FAILURE;
    curve448_scalar_t nonce_scalar;
    uint8_t nonce_point[EDDSA_448_PUBLIC_BYTES] = { 0 };
    unsigned int c;
    curve448_scalar_t challenge_scalar;
    if (hashctx == NULL)
        return C448_FAILURE;
    {
        uint8_t expanded[EDDSA_448_PRIVATE_BYTES * 2];
        if (!oneshot_hash(expanded, sizeof(expanded), privkey,
                          EDDSA_448_PRIVATE_BYTES))
            goto err;
        clamp(expanded);
        curve448_scalar_decode_long(secret_scalar, expanded,
                                    EDDSA_448_PRIVATE_BYTES);
        if (!hash_init_with_dom(hashctx, prehashed, 0, context, context_len)
                || !EVP_DigestUpdate(hashctx,
                                     expanded + EDDSA_448_PRIVATE_BYTES,
                                     EDDSA_448_PRIVATE_BYTES)
                || (message_len > 0
                    && !EVP_DigestUpdate(hashctx, message, message_len))) {
            OPENSSL_cleanse(expanded, sizeof(expanded));
            goto err;
        }
        OPENSSL_cleanse(expanded, sizeof(expanded));
    }
    {
        uint8_t nonce[2 * EDDSA_448_PRIVATE_BYTES];
        if (!EVP_DigestFinalXOF(hashctx, nonce, sizeof(nonce)))
            goto err;
        curve448_scalar_decode_long(nonce_scalar, nonce, sizeof(nonce));
        OPENSSL_cleanse(nonce, sizeof(nonce));
    }
    {
        curve448_scalar_t nonce_scalar_2;
        curve448_point_t p;
        curve448_scalar_halve(nonce_scalar_2, nonce_scalar);
        for (c = 2; c < C448_EDDSA_ENCODE_RATIO; c <<= 1)
            curve448_scalar_halve(nonce_scalar_2, nonce_scalar_2);
        curve448_precomputed_scalarmul(p, curve448_precomputed_base,
                                       nonce_scalar_2);
        curve448_point_mul_by_ratio_and_encode_like_eddsa(nonce_point, p);
        curve448_point_destroy(p);
        curve448_scalar_destroy(nonce_scalar_2);
    }
    {
        uint8_t challenge[2 * EDDSA_448_PRIVATE_BYTES];
        if (!hash_init_with_dom(hashctx, prehashed, 0, context, context_len)
                || !EVP_DigestUpdate(hashctx, nonce_point, sizeof(nonce_point))
                || !EVP_DigestUpdate(hashctx, pubkey, EDDSA_448_PUBLIC_BYTES)
                || (message_len > 0
                    && !EVP_DigestUpdate(hashctx, message, message_len))
                || !EVP_DigestFinalXOF(hashctx, challenge, sizeof(challenge)))
            goto err;
        curve448_scalar_decode_long(challenge_scalar, challenge,
                                    sizeof(challenge));
        OPENSSL_cleanse(challenge, sizeof(challenge));
    }
    curve448_scalar_mul(challenge_scalar, challenge_scalar, secret_scalar);
    curve448_scalar_add(challenge_scalar, challenge_scalar, nonce_scalar);
    OPENSSL_cleanse(signature, EDDSA_448_SIGNATURE_BYTES);
    memcpy(signature, nonce_point, sizeof(nonce_point));
    curve448_scalar_encode(&signature[EDDSA_448_PUBLIC_BYTES],
                           challenge_scalar);
    curve448_scalar_destroy(secret_scalar);
    curve448_scalar_destroy(nonce_scalar);
    curve448_scalar_destroy(challenge_scalar);
    ret = C448_SUCCESS;
 err:
    EVP_MD_CTX_free(hashctx);
    return ret;
}
['c448_error_t c448_ed448_sign(\n                        uint8_t signature[EDDSA_448_SIGNATURE_BYTES],\n                        const uint8_t privkey[EDDSA_448_PRIVATE_BYTES],\n                        const uint8_t pubkey[EDDSA_448_PUBLIC_BYTES],\n                        const uint8_t *message, size_t message_len,\n                        uint8_t prehashed, const uint8_t *context,\n                        size_t context_len)\n{\n    curve448_scalar_t secret_scalar;\n    EVP_MD_CTX *hashctx = EVP_MD_CTX_new();\n    c448_error_t ret = C448_FAILURE;\n    curve448_scalar_t nonce_scalar;\n    uint8_t nonce_point[EDDSA_448_PUBLIC_BYTES] = { 0 };\n    unsigned int c;\n    curve448_scalar_t challenge_scalar;\n    if (hashctx == NULL)\n        return C448_FAILURE;\n    {\n        uint8_t expanded[EDDSA_448_PRIVATE_BYTES * 2];\n        if (!oneshot_hash(expanded, sizeof(expanded), privkey,\n                          EDDSA_448_PRIVATE_BYTES))\n            goto err;\n        clamp(expanded);\n        curve448_scalar_decode_long(secret_scalar, expanded,\n                                    EDDSA_448_PRIVATE_BYTES);\n        if (!hash_init_with_dom(hashctx, prehashed, 0, context, context_len)\n                || !EVP_DigestUpdate(hashctx,\n                                     expanded + EDDSA_448_PRIVATE_BYTES,\n                                     EDDSA_448_PRIVATE_BYTES)\n                || (message_len > 0\n                    && !EVP_DigestUpdate(hashctx, message, message_len))) {\n            OPENSSL_cleanse(expanded, sizeof(expanded));\n            goto err;\n        }\n        OPENSSL_cleanse(expanded, sizeof(expanded));\n    }\n    {\n        uint8_t nonce[2 * EDDSA_448_PRIVATE_BYTES];\n        if (!EVP_DigestFinalXOF(hashctx, nonce, sizeof(nonce)))\n            goto err;\n        curve448_scalar_decode_long(nonce_scalar, nonce, sizeof(nonce));\n        OPENSSL_cleanse(nonce, sizeof(nonce));\n    }\n    {\n        curve448_scalar_t nonce_scalar_2;\n        curve448_point_t p;\n        curve448_scalar_halve(nonce_scalar_2, nonce_scalar);\n        for (c = 2; c < C448_EDDSA_ENCODE_RATIO; c <<= 1)\n            curve448_scalar_halve(nonce_scalar_2, nonce_scalar_2);\n        curve448_precomputed_scalarmul(p, curve448_precomputed_base,\n                                       nonce_scalar_2);\n        curve448_point_mul_by_ratio_and_encode_like_eddsa(nonce_point, p);\n        curve448_point_destroy(p);\n        curve448_scalar_destroy(nonce_scalar_2);\n    }\n    {\n        uint8_t challenge[2 * EDDSA_448_PRIVATE_BYTES];\n        if (!hash_init_with_dom(hashctx, prehashed, 0, context, context_len)\n                || !EVP_DigestUpdate(hashctx, nonce_point, sizeof(nonce_point))\n                || !EVP_DigestUpdate(hashctx, pubkey, EDDSA_448_PUBLIC_BYTES)\n                || (message_len > 0\n                    && !EVP_DigestUpdate(hashctx, message, message_len))\n                || !EVP_DigestFinalXOF(hashctx, challenge, sizeof(challenge)))\n            goto err;\n        curve448_scalar_decode_long(challenge_scalar, challenge,\n                                    sizeof(challenge));\n        OPENSSL_cleanse(challenge, sizeof(challenge));\n    }\n    curve448_scalar_mul(challenge_scalar, challenge_scalar, secret_scalar);\n    curve448_scalar_add(challenge_scalar, challenge_scalar, nonce_scalar);\n    OPENSSL_cleanse(signature, EDDSA_448_SIGNATURE_BYTES);\n    memcpy(signature, nonce_point, sizeof(nonce_point));\n    curve448_scalar_encode(&signature[EDDSA_448_PUBLIC_BYTES],\n                           challenge_scalar);\n    curve448_scalar_destroy(secret_scalar);\n    curve448_scalar_destroy(nonce_scalar);\n    curve448_scalar_destroy(challenge_scalar);\n    ret = C448_SUCCESS;\n err:\n    EVP_MD_CTX_free(hashctx);\n    return ret;\n}', 'EVP_MD_CTX *EVP_MD_CTX_new(void)\n{\n    return OPENSSL_zalloc(sizeof(EVP_MD_CTX));\n}', 'void *CRYPTO_zalloc(size_t num, const char *file, int line)\n{\n    void *ret = CRYPTO_malloc(num, file, line);\n    FAILTEST();\n    if (ret != NULL)\n        memset(ret, 0, num);\n    return ret;\n}', 'void *CRYPTO_malloc(size_t num, const char *file, int line)\n{\n    void *ret = NULL;\n    INCREMENT(malloc_count);\n    if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)\n        return malloc_impl(num, file, line);\n    if (num == 0)\n        return NULL;\n    FAILTEST();\n    allow_customize = 0;\n#ifndef OPENSSL_NO_CRYPTO_MDEBUG\n    if (call_malloc_debug) {\n        CRYPTO_mem_debug_malloc(NULL, num, 0, file, line);\n        ret = malloc(num);\n        CRYPTO_mem_debug_malloc(ret, num, 1, file, line);\n    } else {\n        ret = malloc(num);\n    }\n#else\n    (void)(file); (void)(line);\n    ret = malloc(num);\n#endif\n    return ret;\n}', 'static c448_error_t oneshot_hash(uint8_t *out, size_t outlen,\n                                 const uint8_t *in, size_t inlen)\n{\n    EVP_MD_CTX *hashctx = EVP_MD_CTX_new();\n    if (hashctx == NULL)\n        return C448_FAILURE;\n    if (!EVP_DigestInit_ex(hashctx, EVP_shake256(), NULL)\n            || !EVP_DigestUpdate(hashctx, in, inlen)\n            || !EVP_DigestFinalXOF(hashctx, out, outlen)) {\n        EVP_MD_CTX_free(hashctx);\n        return C448_FAILURE;\n    }\n    EVP_MD_CTX_free(hashctx);\n    return C448_SUCCESS;\n}', 'EVP_MD_SHAKE(256)', 'void EVP_MD_CTX_free(EVP_MD_CTX *ctx)\n{\n    EVP_MD_CTX_reset(ctx);\n    OPENSSL_free(ctx);\n}', 'void CRYPTO_free(void *str, const char *file, int line)\n{\n    INCREMENT(free_count);\n    if (free_impl != NULL && free_impl != &CRYPTO_free) {\n        free_impl(str, file, line);\n        return;\n    }\n#ifndef OPENSSL_NO_CRYPTO_MDEBUG\n    if (call_malloc_debug) {\n        CRYPTO_mem_debug_free(str, 0, file, line);\n        free(str);\n        CRYPTO_mem_debug_free(str, 1, file, line);\n    } else {\n        free(str);\n    }\n#else\n    free(str);\n#endif\n}']