Skip to content

Commit fcaea7e

Browse files
Nick Bofferdingdcrowell77
authored andcommitted
Update sha512 algorithm to correct license
Change-Id: Ib671bc08cf7912ef1bee11505c9c5d4dc662b453 RTC: 172339 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/40731 Reviewed-by: Timothy R. Block <block@us.ibm.com> Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Reviewed-by: Michael Baiocchi <mbaiocch@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Reviewed-by: Stephen M. Cprek <smcprek@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
1 parent 77cb3c7 commit fcaea7e

File tree

6 files changed

+218
-31
lines changed

6 files changed

+218
-31
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
This is an automatically generated prolog.
2+
3+
$SOURCE_BEGIN_TAG $filename $SOURCE_END_TAG
4+
5+
OpenPOWER $projectName Project
6+
7+
$copyrightStr $copyrightYear
8+
$copyright_Contributors
9+
10+
Licensed under the Apache License, Version 2.0 (the "License");
11+
you may not use this file except in compliance with the License.
12+
You may obtain a copy of the License at
13+
14+
http://www.apache.org/licenses/LICENSE-2.0
15+
16+
Unless required by applicable law or agreed to in writing, software
17+
distributed under the License is distributed on an "AS IS" BASIS,
18+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
19+
implied. See the License for the specific language governing
20+
permissions and limitations under the License.
21+
22+
Copyright (c) 2000-2001, Aaron D. Gifford
23+
All rights reserved.
24+
25+
Redistribution and use in source and binary forms, with or without
26+
modification, are permitted provided that the following conditions
27+
are met:
28+
1. Redistributions of source code must retain the above copyright
29+
notice, this list of conditions and the following disclaimer.
30+
2. Redistributions in binary form must reproduce the above copyright
31+
notice, this list of conditions and the following disclaimer in
32+
the documentation and/or other materials provided with the
33+
distribution.
34+
3. Neither the name of the copyright holder nor the names of
35+
contributors may be used to endorse or promote products derived
36+
from this software without specific prior written permission.
37+
38+
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTOR(S) ``AS IS''
39+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
40+
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
41+
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR
42+
CONTRIBUTOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES \(INCLUDING, BUT NOT
44+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
45+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION\) HOWEVER CAUSED AND ON ANY
46+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
47+
\(INCLUDING NEGLIGENCE OR OTHERWISE\) ARISING IN ANY WAY OUT OF THE USE
48+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
49+
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
/* IBM_PROLOG_BEGIN_TAG */
2+
/* This is an automatically generated prolog. */
3+
/* */
4+
/* $Source: src/include/securerom/contrib/sha512.H $ */
5+
/* */
6+
/* OpenPOWER HostBoot Project */
7+
/* */
8+
/* Contributors Listed Below - COPYRIGHT 2016,2017 */
9+
/* [+] International Business Machines Corp. */
10+
/* */
11+
/* */
12+
/* Licensed under the Apache License, Version 2.0 (the "License"); */
13+
/* you may not use this file except in compliance with the License. */
14+
/* You may obtain a copy of the License at */
15+
/* */
16+
/* http://www.apache.org/licenses/LICENSE-2.0 */
17+
/* */
18+
/* Unless required by applicable law or agreed to in writing, software */
19+
/* distributed under the License is distributed on an "AS IS" BASIS, */
20+
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
21+
/* implied. See the License for the specific language governing */
22+
/* permissions and limitations under the License. */
23+
/* */
24+
/* Copyright (c) 2000-2001, Aaron D. Gifford */
25+
/* All rights reserved. */
26+
/* */
27+
/* Redistribution and use in source and binary forms, with or without */
28+
/* modification, are permitted provided that the following conditions */
29+
/* are met: */
30+
/* 1. Redistributions of source code must retain the above copyright */
31+
/* notice, this list of conditions and the following disclaimer. */
32+
/* 2. Redistributions in binary form must reproduce the above copyright */
33+
/* notice, this list of conditions and the following disclaimer in */
34+
/* the documentation and/or other materials provided with the */
35+
/* distribution. */
36+
/* 3. Neither the name of the copyright holder nor the names of */
37+
/* contributors may be used to endorse or promote products derived */
38+
/* from this software without specific prior written permission. */
39+
/* */
40+
/* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTOR(S) ``AS IS'' */
41+
/* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, */
42+
/* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A */
43+
/* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR */
44+
/* CONTRIBUTOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
45+
/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */
46+
/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */
47+
/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */
48+
/* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */
49+
/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */
50+
/* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
51+
/* */
52+
/* */
53+
/* IBM_PROLOG_END_TAG */
54+
#ifndef SHA512_H
55+
#define SHA512_H
56+
57+
#define SHA512_BLOCK_LENGTH 128
58+
#define SHA512_DIGEST_LENGTH 64
59+
60+
#include <stdlib.h>
61+
62+
typedef uint8_t __attribute__((aligned(8))) \
63+
sha2_hash_t[ SHA512_DIGEST_LENGTH / sizeof(uint8_t) ];
64+
65+
typedef uint8_t sha2_byte; /* Exactly 1 byte */
66+
typedef uint32_t sha2_word32; /* Exactly 4 bytes */
67+
typedef uint64_t sha2_word64; /* Exactly 8 bytes */
68+
69+
typedef struct _SHA512_CTX
70+
{
71+
uint64_t state[8];
72+
uint64_t bitcount[2];
73+
uint8_t buffer[SHA512_BLOCK_LENGTH];
74+
} SHA512_CTX;
75+
76+
extern "C"
77+
void SHA512_Init(SHA512_CTX* context);
78+
extern "C"
79+
void SHA512_Update(SHA512_CTX* context, const sha2_byte *data, size_t len);
80+
extern "C"
81+
void SHA512_Final(SHA512_CTX* context, sha2_hash_t *result);
82+
extern "C"
83+
void SHA512_Hash(const sha2_byte *data, size_t len, sha2_hash_t *result);
84+
85+
#endif

src/include/securerom/sha512.H

Lines changed: 3 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -22,35 +22,8 @@
2222
/* permissions and limitations under the License. */
2323
/* */
2424
/* IBM_PROLOG_END_TAG */
25-
#ifndef SHA512_H
26-
#define SHA512_H
27-
28-
#define SHA512_BLOCK_LENGTH 128
29-
#define SHA512_DIGEST_LENGTH 64
30-
31-
#include <stdlib.h>
32-
33-
typedef uint8_t __attribute__((aligned(8))) \
34-
sha2_hash_t[ SHA512_DIGEST_LENGTH / sizeof(uint8_t) ];
35-
36-
typedef uint8_t sha2_byte; /* Exactly 1 byte */
37-
typedef uint32_t sha2_word32; /* Exactly 4 bytes */
38-
typedef uint64_t sha2_word64; /* Exactly 8 bytes */
39-
40-
typedef struct _SHA512_CTX
41-
{
42-
uint64_t state[8];
43-
uint64_t bitcount[2];
44-
uint8_t buffer[SHA512_BLOCK_LENGTH];
45-
} SHA512_CTX;
46-
47-
extern "C"
48-
void SHA512_Init(SHA512_CTX* context);
49-
extern "C"
50-
void SHA512_Update(SHA512_CTX* context, const sha2_byte *data, size_t len);
51-
extern "C"
52-
void SHA512_Final(SHA512_CTX* context, sha2_hash_t *result);
53-
extern "C"
54-
void SHA512_Hash(const sha2_byte *data, size_t len, sha2_hash_t *result);
5525

26+
#ifndef __SHA512_H
27+
#define __SHA512_H
28+
#include <securerom/contrib/sha512.H>
5629
#endif

src/securerom/contrib/LICENSE_PROLOG

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
This is an automatically generated prolog.
2+
3+
$SOURCE_BEGIN_TAG $filename $SOURCE_END_TAG
4+
5+
OpenPOWER $projectName Project
6+
7+
$copyrightStr $copyrightYear
8+
$copyright_Contributors
9+
10+
Licensed under the Apache License, Version 2.0 (the "License");
11+
you may not use this file except in compliance with the License.
12+
You may obtain a copy of the License at
13+
14+
http://www.apache.org/licenses/LICENSE-2.0
15+
16+
Unless required by applicable law or agreed to in writing, software
17+
distributed under the License is distributed on an "AS IS" BASIS,
18+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
19+
implied. See the License for the specific language governing
20+
permissions and limitations under the License.
21+
22+
Copyright (c) 2000-2001, Aaron D. Gifford
23+
All rights reserved.
24+
25+
Redistribution and use in source and binary forms, with or without
26+
modification, are permitted provided that the following conditions
27+
are met:
28+
1. Redistributions of source code must retain the above copyright
29+
notice, this list of conditions and the following disclaimer.
30+
2. Redistributions in binary form must reproduce the above copyright
31+
notice, this list of conditions and the following disclaimer in
32+
the documentation and/or other materials provided with the
33+
distribution.
34+
3. Neither the name of the copyright holder nor the names of
35+
contributors may be used to endorse or promote products derived
36+
from this software without specific prior written permission.
37+
38+
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTOR(S) ``AS IS''
39+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
40+
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
41+
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR
42+
CONTRIBUTOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES \(INCLUDING, BUT NOT
44+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
45+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION\) HOWEVER CAUSED AND ON ANY
46+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
47+
\(INCLUDING NEGLIGENCE OR OTHERWISE\) ARISING IN ANY WAY OUT OF THE USE
48+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
49+

src/securerom/sha512.C renamed to src/securerom/contrib/sha512.C

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* IBM_PROLOG_BEGIN_TAG */
22
/* This is an automatically generated prolog. */
33
/* */
4-
/* $Source: src/securerom/sha512.C $ */
4+
/* $Source: src/securerom/contrib/sha512.C $ */
55
/* */
66
/* OpenPOWER HostBoot Project */
77
/* */
@@ -21,6 +21,35 @@
2121
/* implied. See the License for the specific language governing */
2222
/* permissions and limitations under the License. */
2323
/* */
24+
/* Copyright (c) 2000-2001, Aaron D. Gifford */
25+
/* All rights reserved. */
26+
/* */
27+
/* Redistribution and use in source and binary forms, with or without */
28+
/* modification, are permitted provided that the following conditions */
29+
/* are met: */
30+
/* 1. Redistributions of source code must retain the above copyright */
31+
/* notice, this list of conditions and the following disclaimer. */
32+
/* 2. Redistributions in binary form must reproduce the above copyright */
33+
/* notice, this list of conditions and the following disclaimer in */
34+
/* the documentation and/or other materials provided with the */
35+
/* distribution. */
36+
/* 3. Neither the name of the copyright holder nor the names of */
37+
/* contributors may be used to endorse or promote products derived */
38+
/* from this software without specific prior written permission. */
39+
/* */
40+
/* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTOR(S) ``AS IS'' */
41+
/* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, */
42+
/* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A */
43+
/* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR */
44+
/* CONTRIBUTOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
45+
/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */
46+
/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */
47+
/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */
48+
/* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */
49+
/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */
50+
/* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
51+
/* */
52+
/* */
2453
/* IBM_PROLOG_END_TAG */
2554
/********************************************************************
2655
* SHA-512 BIG-Endian Version

src/securerom/makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ OBJS += hw_utils.o
4545
OBJS += rom_entry.o
4646
OBJS += secureromasm.o
4747

48+
VPATH += contrib
49+
4850
OPT_LEVEL = -Os
4951

5052
include ${ROOTPATH}/config.mk

0 commit comments

Comments
 (0)