title: I have problems copying char on the GPU with CUDA
body: <p>Host:</p>
  
  <pre><code>unsigned char exp[128];
  unsigned char __e;
  
  i = cudaMalloc( (void**)&amp;__e, 128 * sizeof(unsigned char) );
  if(i != cudaSuccess)
      printf("cudaMalloc __e FAIL! Code: %d\n", i);
  
  BN_bn2bin128B(e, exp);  // copy data from e to exp, no problems since here
  
  i = cudaMemcpy( &amp;__e, &amp;exp, 128 * sizeof(unsigned char), cudaMemcpyHostToDevice);
  if(i != cudaSuccess)
      printf("cudaMemcpy __e FAIL! Code: %d\n", i);
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>cudaMemcpy __e FAIL! Code: 11
  </code></pre>
  
  <p>Error 11 corresponds to:</p>
  
  <pre><code>cudaErrorInvalidValue = 11, ///&lt; Invalid value
  </code></pre>
  
  <p>Why? Where is the error?</p>