Generalized modular square root code