/** * (C) Copyright Projet SECRET, INRIA, Rocquencourt * (C) Bhaskar Biswas and Nicolas Sendrier * * (C) 2014 cryptosource GmbH * (C) 2014 Falko Strenzke fstrenzke@cryptosource.de * * Botan is released under the Simplified BSD License (see license.txt) * */ #include #include namespace Botan { binary_matrix::binary_matrix (u32bit rown, u32bit coln) { m_coln = coln; m_rown = rown; m_rwdcnt = (1 + (m_coln - 1) / BITS_PER_U32); m_elem = std::vector(m_rown * m_rwdcnt); } void binary_matrix::row_xor(u32bit a, u32bit b) { u32bit i; for(i=0;i binary_matrix::row_reduced_echelon_form() { u32bit i, failcnt, findrow, max=m_coln - 1; secure_vector perm(m_coln); for(i=0;i=0;j--)//fill the column with 0's upwards too. { if(coef(j,(max))) { row_xor(j,i); } } } }//end for(i) return perm; } } // end namespace Botan