/** * (C) Copyright Projet SECRET, INRIA, Rocquencourt * (C) Bhaskar Biswas and Nicolas Sendrier * * (C) 2014 cryptosource GmbH * (C) 2014 Falko Strenzke fstrenzke@cryptosource.de * * Distributed under the terms of the Botan license * */ #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_alloc_size = m_rown * (*this).m_rwdcnt * sizeof (u32bit); m_elem = std::vector((*this).m_alloc_size/4); } 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