/* * dm-verity Forward Error Correction (FEC) support * * Copyright (C) 2015, Google, Inc. All rights reserved. * * This file is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This file is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this file; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef _FEC_H #define _FEC_H #include /* ecc parameters */ #define FEC_RSM 255 #define FEC_MIN_RSN 231 #define FEC_MAX_RSN 253 /* parameters to init_rs_char */ #define FEC_PARAMS(roots) \ 8, /* symbol size in bits */ \ 0x11d, /* field generator polynomial coefficients */ \ 0, /* first root of the generator */ \ 1, /* primitive element to generate polynomial roots */ \ (roots), /* polynomial degree (number of roots) */ \ 0 /* padding bytes at the front of shortened block */ struct crypt_device; struct crypt_params_verity; int VERITY_FEC_create(struct crypt_device *cd, struct crypt_params_verity *params); #endif