2N/A * Copyright (C) 2008 Free Software Foundation, Inc. 2N/A * This file is part of Libgcrypt. 2N/A * Libgcrypt is free software; you can redistribute it and/or modify 2N/A * it under the terms of the GNU Lesser General Public License as 2N/A * published by the Free Software Foundation; either version 2.1 of 2N/A * the License, or (at your option) any later version. 2N/A * Libgcrypt is distributed in the hope that it will be useful, 2N/A * but WITHOUT ANY WARRANTY; without even the implied warranty of 2N/A * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 2N/A * GNU Lesser General Public License for more details. 2N/A * You should have received a copy of the GNU Lesser General Public 2N/A/* Run a selftest for hash algorithm ALGO. If the resulting digest 2N/A return NULL. If an error occurs, return a static text string 2N/A describing the error. 2N/A DATAMODE controls what will be hashed according to this table: 2N/A 0 - Hash the supplied DATA of DATALEN. 2N/A 1 - Hash one million times a 'a'. DATA and DATALEN are ignored. 2N/A return "digest size does not match expected size";
2N/A return "gcry_md_open failed";
2N/A case 1:
/* Hash one million times an "a". */ 2N/A /* Write in odd size chunks so that we test the buffering. */ 2N/A for (i = 0; i <
1000; i++)