Here you can find the source of sum(byte[] in, byte[] gamma)
Parameter | Description |
---|---|
in | clear text |
gamma | gamma parameter |
public static byte[] sum(byte[] in, byte[] gamma)
//package com.java2s; public class Main { /**/*w w w. j a v a2 s. c o m*/ * componentwise addition modulo 2 (XOR) * * @param in clear text * @param gamma gamma parameter * @return */ public static byte[] sum(byte[] in, byte[] gamma) { byte[] out = new byte[in.length]; for (int i = 0; i < in.length; i++) { out[i] = (byte) (in[i] ^ gamma[i]); } return out; } }