title: How AES/GCM deals with data smaller than block size?
body: <p>I am using <a href="https://bouncycastle.org/" rel="nofollow">bouncy castle library</a> for encryption and decryption in c# and I was wondering how to deal with plain text smaller than block size?</p>
  
  <p>here is what I have done so far:</p>
  
  <pre><code>AesFastEngine engine = new AesFastEngine();
  GcmBlockCipher cipher = new GcmBlockCipher(engine);
  AeadParameters param = new AeadParameters(new KeyParameters(key), 128, iv, null);
  cipher.Init(true, parameters);
  
  byte[] encData = new byte[plain.Length];
  cipher.ProcessBytes(plain, 0, plain.Length, encData, 0);
  </code></pre>
  
  <p>when the plain data is smaller then block size it does nothing.</p>