--XXX
Optimize bn+0 and 0+bn.
Check BN_* functions status and report an error.
Implement bnerror() and use it.
Add more error checking.