Finish up SM3

Done!
I realize this is not part of your change. but what if len is 0?