Solved by albanD in post #11 
              
              
                True, but the memory would be an issue. 

I’m not sure to see why. 
Currently, you already have a x → M → z → PADDING → z_p 
I think you want (x, z_g) → M_AND_PADDING → z_p 
And in that new custom Function, you don’t need to do anything beyond what the padding is currently doing.