drivers/crypto: use ring size function