This repository was archived by the owner on Aug 3, 2022. It is now read-only.
mirrored from https://chromium.googlesource.com/webm/webm-tools
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add support for CTR encryption based on WebM encryption RFC v0.3. - Add version information. - Add support to encrypt audio and video stream with independent settings. - Add EncryptModule and DecryptModule classes. - Added shared/webm_endian files. - Added support for creating the HMAC data. - Added support for checking the integrity of the data during decryption. - Added support to not perform encrypt or decrypt for testing. - Removed asserts. - Added comments to classes and functions. - Added ContentEncodings output to webm_info. - Added IV output to webm_info. - Fixed audio or video only encryption. - Prepend a signal byte to all frames to signify if the frame data is compressed or not. - Add a command line parameter to not encrypt frames on a stream from [0, <value>) milliseconds. - Update webm_info to output encrypted info. - Added "Release DLL" and "Debug DLL" configurations to Windows solution. - PS15 Addressed comments. - PS16 Addressed comments. Created swap64_check_little_endian to handle swapping bytes. - PS17 Addressed comments. Fix copy/paste bug in swap64_check_little_endian. - PS18 Addressed comments. - PS20 Changed errors to log to stderr. Addressing comments. Change-Id: I10a94c372cda9722900de9a09a5bd1b198e70e94
- Loading branch information
Frank Galligan
committed
Aug 1, 2012
1 parent
e679d38
commit e89e55f
Showing
14 changed files
with
1,455 additions
and
467 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
*.sln -crlf | ||
*.vcproj -crlf | ||
*.vcxproj -crlf | ||
*.vsprops -crlf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// Copyright (c) 2012 The WebM project authors. All Rights Reserved. | ||
// | ||
// Use of this source code is governed by a BSD-style license | ||
// that can be found in the LICENSE file in the root of the source | ||
// tree. An additional intellectual property rights grant can be found | ||
// in the file PATENTS. All contributing project authors may | ||
// be found in the AUTHORS file in the root of the source tree. | ||
|
||
#include "webm_endian.h" | ||
|
||
namespace { | ||
|
||
// Swaps unsigned 64 bit values to big endian if needed. Returns |value| | ||
// unmodified if architecture is big endian. Returns swapped bytes of |value| | ||
// if architecture is little endian. Returns 0 otherwise. | ||
webm_tools::uint64 swap64_check_little_endian(webm_tools::uint64 value) { | ||
// Check endianness. | ||
union { | ||
webm_tools::uint64 val64; | ||
webm_tools::uint8 c[8]; | ||
} check; | ||
check.val64 = 0x0123456789ABCDEFULL; | ||
|
||
// Check for big endian. | ||
if (check.c[7] == 0xEF) | ||
return value; | ||
|
||
// Check for not little endian. | ||
if (check.c[0] != 0xEF) | ||
return 0; | ||
|
||
return value << 56 | | ||
((value << 40) & 0x00FF000000000000ULL) | | ||
((value << 24) & 0x0000FF0000000000ULL) | | ||
((value << 8) & 0x000000FF00000000ULL) | | ||
((value >> 8) & 0x00000000FF000000ULL) | | ||
((value >> 24) & 0x0000000000FF0000ULL) | | ||
((value >> 40) & 0x000000000000FF00ULL) | | ||
value >> 56; | ||
} | ||
|
||
} // namespace | ||
|
||
namespace webm_tools { | ||
|
||
uint64 host_to_bigendian(uint64 value) { | ||
return swap64_check_little_endian(value); | ||
} | ||
|
||
uint64 bigendian_to_host(uint64 value) { | ||
return swap64_check_little_endian(value); | ||
} | ||
|
||
} // namespace webm_tools |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Copyright (c) 2012 The WebM project authors. All Rights Reserved. | ||
// | ||
// Use of this source code is governed by a BSD-style license | ||
// that can be found in the LICENSE file in the root of the source | ||
// tree. An additional intellectual property rights grant can be found | ||
// in the file PATENTS. All contributing project authors may | ||
// be found in the AUTHORS file in the root of the source tree. | ||
|
||
#ifndef SHARED_WEBM_ENDIAN_H_ | ||
#define SHARED_WEBM_ENDIAN_H_ | ||
|
||
#include "webm_tools_types.h" | ||
|
||
namespace webm_tools { | ||
|
||
// Swaps unsigned 64 bit values to big endian if needed. Returns |value| if | ||
// architecture is big endian. Returns little endian value if architecture is | ||
// little endian. Returns 0 otherwise. | ||
uint64 host_to_bigendian(uint64 value); | ||
|
||
// Swaps unsigned 64 bit values to little endian if needed. Returns |value| if | ||
// architecture is big endian. Returns little endian value if architecture is | ||
// little endian. Returns 0 otherwise. | ||
uint64 bigendian_to_host(uint64 value); | ||
|
||
} // namespace webm_tools | ||
|
||
#endif // SHARED_WEBM_ENDIAN_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<ImportGroup Label="PropertySheets" /> | ||
<PropertyGroup Label="UserMacros"> | ||
<CHROMIUM_INC>D:\src\Chromium\Src</CHROMIUM_INC> | ||
</PropertyGroup> | ||
<PropertyGroup /> | ||
<ItemDefinitionGroup /> | ||
<ItemGroup> | ||
<BuildMacro Include="CHROMIUM_INC"> | ||
<Value>$(CHROMIUM_INC)</Value> | ||
<EnvironmentVariable>true</EnvironmentVariable> | ||
</BuildMacro> | ||
</ItemGroup> | ||
</Project> |
Oops, something went wrong.