nickva commented on a change in pull request #3568:
URL: https://github.com/apache/couchdb/pull/3568#discussion_r633801057



##########
File path: src/aegis/src/aegis_keywrap.erl
##########
@@ -50,48 +51,66 @@ unwrap(_WrappingKey, A, R, 0) ->
     <<A/binary, R/binary>>;
 unwrap(WrappingKey, <<A:64>>, R, T) ->
     RestSize = bit_size(R) - 64,
-    <<Rest:RestSize, R2: 64>> = R,
+    <<Rest:RestSize, R2:64>> = R,

Review comment:
       +2

##########
File path: src/aegis/src/aegis_keywrap.erl
##########
@@ -50,48 +51,66 @@ unwrap(_WrappingKey, A, R, 0) ->
     <<A/binary, R/binary>>;
 unwrap(WrappingKey, <<A:64>>, R, T) ->
     RestSize = bit_size(R) - 64,
-    <<Rest:RestSize, R2: 64>> = R,
+    <<Rest:RestSize, R2:64>> = R,
     <<MSB_B:64, LSB_B:64>> = ?aes_ecb_decrypt(WrappingKey, <<(A bxor T):64, 
R2:64>>),
     unwrap(WrappingKey, <<MSB_B:64>>, <<LSB_B:64, Rest:RestSize>>, T - 1).
 
-
 -ifdef(TEST).
 -include_lib("eunit/include/eunit.hrl").
 
 wrap_test_() ->
     [
-     %% 128 KEK / 128 DATA
-     test_wrap_unwrap(<<16#000102030405060708090A0B0C0D0E0F:128>>,
-                      <<16#00112233445566778899AABBCCDDEEFF:128>>,
-                      
<<16#1FA68B0A8112B447AEF34BD8FB5A7B829D3E862371D2CFE5:192>>),
-     %% 192 KEK / 128 DATA
-     
test_wrap_unwrap(<<16#000102030405060708090A0B0C0D0E0F1011121314151617:192>>,
-                      <<16#00112233445566778899AABBCCDDEEFF:128>>,
-                      
<<16#96778B25AE6CA435F92B5B97C050AED2468AB8A17AD84E5D:192>>),
-     %% 256 KEK / 128 DATA
-     
test_wrap_unwrap(<<16#000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F:256>>,
-                      <<16#00112233445566778899AABBCCDDEEFF:128>>,
-                      
<<16#64E8C3F9CE0F5BA263E9777905818A2A93C8191E7D6E8AE7:192>>),
-     %% 192 KEK / 192 DATA
-     
test_wrap_unwrap(<<16#000102030405060708090A0B0C0D0E0F1011121314151617:192>>,
-                      
<<16#00112233445566778899AABBCCDDEEFF0001020304050607:192>>,
-                      
<<16#031D33264E15D33268F24EC260743EDCE1C6C7DDEE725A936BA814915C6762D2:256>>),
-     %% 256 KEK / 192 DATA
-     
test_wrap_unwrap(<<16#000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F:256>>,
-                      
<<16#00112233445566778899AABBCCDDEEFF0001020304050607:192>>,
-                      
<<16#A8F9BC1612C68B3FF6E6F4FBE30E71E4769C8B80A32CB8958CD5D17D6B254DA1:256>>),
-     %% 256 KEK / 256 DATA
-     
test_wrap_unwrap(<<16#000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F:256>>,
-                      
<<16#00112233445566778899AABBCCDDEEFF000102030405060708090A0B0C0D0E0F:256>>,
-                      
<<16#28C9F404C4B810F4CBCCB35CFB87F8263F5786E2D80ED326CBC7F0E71A99F43BFB988B9B7A02DD21:320>>)].
+        %% 128 KEK / 128 DATA
+        test_wrap_unwrap(

Review comment:
       +1




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to