config CRYPTO_LIB_CHACHA20POLY1305
        tristate "ChaCha20-Poly1305 AEAD support (8-byte nonce library version)"
-       select CRYPTO
        select CRYPTO_LIB_CHACHA
        select CRYPTO_LIB_POLY1305
        select CRYPTO_LIB_UTILS
-       select CRYPTO_ALGAPI
 
 config CRYPTO_LIB_SHA1
        tristate
 
  * Information: https://tools.ietf.org/html/rfc8439
  */
 
-#include <crypto/algapi.h>
 #include <crypto/chacha20poly1305.h>
 #include <crypto/chacha.h>
 #include <crypto/poly1305.h>
-#include <crypto/scatterwalk.h>
+#include <crypto/utils.h>
 
 #include <linux/unaligned.h>
 #include <linux/kernel.h>
 
        if (unlikely(sl > -POLY1305_DIGEST_SIZE)) {
                poly1305_final(&poly1305_state, b.mac[1]);
-               scatterwalk_map_and_copy(b.mac[encrypt], src, src_len,
-                                        sizeof(b.mac[1]), encrypt);
+               sg_copy_buffer(src, sg_nents(src), b.mac[encrypt],
+                              sizeof(b.mac[1]), src_len, !encrypt);
                ret = encrypt ||
                      !crypto_memneq(b.mac[0], b.mac[1], POLY1305_DIGEST_SIZE);
        }