prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  ignore FRP256v1 in wycheproof tests
  
  
  </issue>
  <code>
  [start of src/cryptography/hazmat/backends/openssl/utils.py]
  1 # This file is dual licensed under the terms of the Apache License, Version
  2 # 2.0, and the BSD License. See the LICENSE file in the root of this repository
  3 # for complete details.
  4 
  5 import typing
  6 
  7 from cryptography.hazmat.primitives import hashes
  8 from cryptography.hazmat.primitives.asymmetric.utils import Prehashed
  9 
  10 if typing.TYPE_CHECKING:
  11     from cryptography.hazmat.backends.openssl.backend import Backend
  12 
  13 
  14 def _evp_pkey_derive(backend: "Backend", evp_pkey, peer_public_key) -> bytes:
  15     ctx = backend._lib.EVP_PKEY_CTX_new(evp_pkey, backend._ffi.NULL)
  16     backend.openssl_assert(ctx != backend._ffi.NULL)
  17     ctx = backend._ffi.gc(ctx, backend._lib.EVP_PKEY_CTX_free)
  18     res = backend._lib.EVP_PKEY_derive_init(ctx)
  19     backend.openssl_assert(res == 1)
  20     res = backend._lib.EVP_PKEY_derive_set_peer(ctx, peer_public_key._evp_pkey)
  21     backend.openssl_assert(res == 1)
  22     keylen = backend._ffi.new("size_t *")
  23     res = backend._lib.EVP_PKEY_derive(ctx, backend._ffi.NULL, keylen)
  24     backend.openssl_assert(res == 1)
  25     backend.openssl_assert(keylen[0] > 0)
  26     buf = backend._ffi.new("unsigned char[]", keylen[0])
  27     res = backend._lib.EVP_PKEY_derive(ctx, buf, keylen)
  28     if res != 1:
  29         errors_with_text = backend._consume_errors_with_text()
  30         raise ValueError("Error computing shared key.", errors_with_text)
  31 
  32     return backend._ffi.buffer(buf, keylen[0])[:]
  33 
  34 
  35 def _calculate_digest_and_algorithm(
  36     data: bytes,
  37     algorithm: typing.Union[Prehashed, hashes.HashAlgorithm],
  38 ) -> typing.Tuple[bytes, hashes.HashAlgorithm]:
  39     if not isinstance(algorithm, Prehashed):
  40         hash_ctx = hashes.Hash(algorithm)
  41         hash_ctx.update(data)
  42         data = hash_ctx.finalize()
  43     else:
  44         algorithm = algorithm._algorithm
  45 
  46     if len(data) != algorithm.digest_size:
  47         raise ValueError(
  48             "The provided data must be the same length as the hash "
  49             "algorithm's digest size."
  50         )
  51 
  52     return (data, algorithm)
  53
  [end of src/cryptography/hazmat/backends/openssl/utils.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/src/cryptography/hazmat/backends/openssl/utils.py b/src/cryptography/hazmat/backends/openssl/utils.py
  --- a/src/cryptography/hazmat/backends/openssl/utils.py
  +++ b/src/cryptography/hazmat/backends/openssl/utils.py
  @@ -18,7 +18,10 @@
       res = backend._lib.EVP_PKEY_derive_init(ctx)
       backend.openssl_assert(res == 1)
       res = backend._lib.EVP_PKEY_derive_set_peer(ctx, peer_public_key._evp_pkey)
  -    backend.openssl_assert(res == 1)
  +    if res != 1:
  +        errors_with_text = backend._consume_errors_with_text()
  +        raise ValueError("Error computing shared key.", errors_with_text)
  +
       keylen = backend._ffi.new("size_t *")
       res = backend._lib.EVP_PKEY_derive(ctx, backend._ffi.NULL, keylen)
       backend.openssl_assert(res == 1)
  
verification_info: {"golden_diff": "diff --git a/src/cryptography/hazmat/backends/openssl/utils.py b/src/cryptography/hazmat/backends/openssl/utils.py\n--- a/src/cryptography/hazmat/backends/openssl/utils.py\n+++ b/src/cryptography/hazmat/backends/openssl/utils.py\n@@ -18,7 +18,10 @@\n     res = backend._lib.EVP_PKEY_derive_init(ctx)\n     backend.openssl_assert(res == 1)\n     res = backend._lib.EVP_PKEY_derive_set_peer(ctx, peer_public_key._evp_pkey)\n-    backend.openssl_assert(res == 1)\n+    if res != 1:\n+        errors_with_text = backend._consume_errors_with_text()\n+        raise ValueError(\"Error computing shared key.\", errors_with_text)\n+\n     keylen = backend._ffi.new(\"size_t *\")\n     res = backend._lib.EVP_PKEY_derive(ctx, backend._ffi.NULL, keylen)\n     backend.openssl_assert(res == 1)\n", "issue": "ignore FRP256v1 in wycheproof tests\n\n", "before_files": [{"content": "# This file is dual licensed under the terms of the Apache License, Version\n# 2.0, and the BSD License. See the LICENSE file in the root of this repository\n# for complete details.\n\nimport typing\n\nfrom cryptography.hazmat.primitives import hashes\nfrom cryptography.hazmat.primitives.asymmetric.utils import Prehashed\n\nif typing.TYPE_CHECKING:\n    from cryptography.hazmat.backends.openssl.backend import Backend\n\n\ndef _evp_pkey_derive(backend: \"Backend\", evp_pkey, peer_public_key) -> bytes:\n    ctx = backend._lib.EVP_PKEY_CTX_new(evp_pkey, backend._ffi.NULL)\n    backend.openssl_assert(ctx != backend._ffi.NULL)\n    ctx = backend._ffi.gc(ctx, backend._lib.EVP_PKEY_CTX_free)\n    res = backend._lib.EVP_PKEY_derive_init(ctx)\n    backend.openssl_assert(res == 1)\n    res = backend._lib.EVP_PKEY_derive_set_peer(ctx, peer_public_key._evp_pkey)\n    backend.openssl_assert(res == 1)\n    keylen = backend._ffi.new(\"size_t *\")\n    res = backend._lib.EVP_PKEY_derive(ctx, backend._ffi.NULL, keylen)\n    backend.openssl_assert(res == 1)\n    backend.openssl_assert(keylen[0] > 0)\n    buf = backend._ffi.new(\"unsigned char[]\", keylen[0])\n    res = backend._lib.EVP_PKEY_derive(ctx, buf, keylen)\n    if res != 1:\n        errors_with_text = backend._consume_errors_with_text()\n        raise ValueError(\"Error computing shared key.\", errors_with_text)\n\n    return backend._ffi.buffer(buf, keylen[0])[:]\n\n\ndef _calculate_digest_and_algorithm(\n    data: bytes,\n    algorithm: typing.Union[Prehashed, hashes.HashAlgorithm],\n) -> typing.Tuple[bytes, hashes.HashAlgorithm]:\n    if not isinstance(algorithm, Prehashed):\n        hash_ctx = hashes.Hash(algorithm)\n        hash_ctx.update(data)\n        data = hash_ctx.finalize()\n    else:\n        algorithm = algorithm._algorithm\n\n    if len(data) != algorithm.digest_size:\n        raise ValueError(\n            \"The provided data must be the same length as the hash \"\n            \"algorithm's digest size.\"\n        )\n\n    return (data, algorithm)\n", "path": "src/cryptography/hazmat/backends/openssl/utils.py"}]}