and from uint256's. This code is really awful though. We probably should just re-implement what we need of it. (Which is very little.) It looks like the author just didn't know about BN_bin2bn and BIN_bn2bin.