updated length of key_expand